ähm...
das ist wirklich seltsam gemacht worden in der klasse...
besonders das ersetzen der i18n trans string pro durchlauf ????
Code: Alles auswählen
//if content has dynamic blocks
if (preg_match("/^.*".preg_quote($this->tags['start'], "/").".*?".preg_quote($this->tags['end'], "/").".*$/s", $content))
{
//split everything into an array
preg_match_all("/^(.*)".preg_quote($this->tags['start'], "/")."(.*?)".preg_quote($this->tags['end'], "/")."(.*)$/s", $content, $pieces);
//safe memory
array_shift($pieces);
$content = "";
//now combine pieces together
//start block
$pieces[0][0] = str_replace($this->needles, $this->replacements, $pieces[0][0]);
$this->replacei18n($pieces[0][0], "i18n");
$this->replacei18n($pieces[0][0], "trans");
$content .= $pieces[0][0];
unset ($pieces[0][0]);
//generate dynamic blocks
for ($a = 0; $a < $this->dyn_cnt; $a ++)
{
$temp = str_replace($this->Dyn_needles[$a], $this->Dyn_replacements[$a], $pieces[1][0]);
$this->replacei18n($temp, "i18n");
$this->replacei18n($temp, "trans");
$content .= $temp;
}
unset ($temp);
//end block
$pieces[2][0] = str_replace($this->needles, $this->replacements, $pieces[2][0]);
$this->replacei18n($pieces[2][0], "i18n");
$this->replacei18n($pieces[2][0], "trans");
$content .= $pieces[2][0];
unset ($pieces[2][0]);
} else
{
$content = str_replace($this->needles, $this->replacements, $content);
$this->replacei18n($content, "i18n");
$this->replacei18n($content, "trans");
}
ersetzen durch
Code: Alles auswählen
// replace i18n strings before replacing other placeholders
$this->replacei18n($content, "i18n");
$this->replacei18n($content, "trans");
//if content has dynamic blocks
if (preg_match("/^.*".preg_quote($this->tags['start'], "/").".*?".preg_quote($this->tags['end'], "/").".*$/s", $content)) {
//split everything into an array
preg_match_all("/^(.*)".preg_quote($this->tags['start'], "/")."(.*?)".preg_quote($this->tags['end'], "/")."(.*)$/s", $content, $pieces);
//safe memory
array_shift($pieces);
$content = "";
//now combine pieces together
//start block
$content .= str_replace($this->needles, $this->replacements, $pieces[0][0]);
unset ($pieces[0][0]);
//generate dynamic blocks
for ($a = 0; $a < $this->dyn_cnt; $a ++) {
$content .= str_replace($this->Dyn_needles[$a], $this->Dyn_replacements[$a], $pieces[1][0]);
}
unset ($pieces[1][0]);
//end block
$content .= str_replace($this->needles, $this->replacements, $pieces[2][0]);
unset ($pieces[2][0]);
} else {
$content = str_replace($this->needles, $this->replacements, $content);
}
sollte auch schneller sein...
der bug ist dann bei mir nicht mehr reproduzierbar...