[quote="Autor"] wird nicht mehr geparst
Verfasst: 29.09.2005 12:23
Hallo zusammen,
Ich hoffe in diesem Forum hier bin ich richtig.
Und zwar wird auf meinem Webspace der BBCode [quote="Autor"] nicht mehr richtig geparst. Der normale [quote]-Tag wird richtig geparst und auch dargestellt, doch sobald ein Autor dazu angegeben wird, funktioniert es nicht mehr.
Ich habe mir mal den Code durchgelesen und bin denk ich auf die Zeile gestoßen, die den Fehler verursacht:
Aus: ./includes/bbcode.php
Komischerweise funktioniert es auf meiner lokalen Testumgebung einwandfrei. Kann mir dabei jemand weiterhelfen?
Danke
Krain
Ich hoffe in diesem Forum hier bin ich richtig.
Und zwar wird auf meinem Webspace der BBCode [quote="Autor"] nicht mehr richtig geparst. Der normale [quote]-Tag wird richtig geparst und auch dargestellt, doch sobald ein Autor dazu angegeben wird, funktioniert es nicht mehr.
Ich habe mir mal den Code durchgelesen und bin denk ich auf die Zeile gestoßen, die den Fehler verursacht:
Aus: ./includes/bbcode.php
Code: Alles auswählen
function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
{
global $lang;
$code_start_html = $bbcode_tpl['code_open'];
$code_end_html = $bbcode_tpl['code_close'];
// First, do all the 1st-level matches. These need an htmlspecialchars() run,
// so they have to be handled differently.
#In folgender Zeile wird der eingegebene Text einfach übersprungen, ohne dass das Tag [quote="Autor"] beachtet wird
$match_count = preg_match_all("#\[code:1:$uid\](.*?)\[/code:1:$uid\]#si", $text, $matches);
for ($i = 0; $i < $match_count; $i++)
{
$before_replace = $matches[1][$i];
$after_replace = $matches[1][$i];
// Replace 2 spaces with " " so non-tabbed code indents without making huge long lines.
$after_replace = str_replace(" ", " ", $after_replace);
// now Replace 2 spaces with " " to catch odd #s of spaces.
$after_replace = str_replace(" ", " ", $after_replace);
// Replace tabs with " " so tabbed code indents sorta right without making huge long lines.
$after_replace = str_replace("\t", " ", $after_replace);
// now Replace space occurring at the beginning of a line
$after_replace = preg_replace("/^ {1}/m", ' ', $after_replace);
$str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";
$replacement = $code_start_html;
$replacement .= $after_replace;
$replacement .= $code_end_html;
$text = str_replace($str_to_match, $replacement, $text);
}
// Now, do all the non-first-level matches. These are simple.
$text = str_replace("[code:$uid]", $code_start_html, $text);
$text = str_replace("[/code:$uid]", $code_end_html, $text);
return $text;
} // bbencode_second_pass_code()
Danke
Krain