(.*?)
Version vom 16. Mai 2018, 15:17 Uhr von Lahnsteiner (Diskussion | Beiträge)
Diese Seite dient zur Erklärung von verschiedenen Fehlercodes die behoben worden sind.
1 Fehler in PHP
1.1 CustomTitle
Mit der Extension CustomTitle trat das Problem auf, dass im Text immer wieder Codeteile dargestellt wurden, wie z.B.
Um dies zu Unterbinden wurden in der CustomTitle.php die Funktion onOutputPageBeforeHTML verändert.
vorheriger Code:
function onOutputPageBeforeHTML(&$out, &$text) { if (($found = strpos($text, 'xxx-CustomTitleStart-xxx')) !== false) { if (preg_match("//", $text, $matches)) { $this->customTitle = $matches[1]; $text = str_replace($matches[0], "", $text); } } if (($found = strpos($text, 'xxx-CustomPageTitleStart-xxx')) !== false) { if (preg_match("//", $text, $matches)) { $this->customPageTitle = $matches[1]; $text = str_replace($matches[0], "", $text); } } return true; }
Lösung:
function onOutputPageBeforeHTML(&$out, &$text) { if (($found = strpos($text, 'xxx-CustomTitleStart-xxx')) !== false) { if (preg_match("//", $text, $matches)) { $this->customTitle = $matches[1]; $text = str_replace($matches[0], "", $text); // replace any remaining occurrences while (preg_match("//", $text, $matches)) { $text = str_replace($matches[0], "", $text); } } } if (($found = strpos($text, 'xxx-CustomPageTitleStart-xxx')) !== false) { if (preg_match("//", $text, $matches)) { $this->customPageTitle = $matches[1]; $text = str_replace($matches[0], "", $text); // replace any remaining occurrences while (preg_match("//", $text, $matches)) { $text = str_replace($matches[0], "", $text); } } } return true; }