-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hello everyone.
When using “\0” in content (body), the preg_replace function inserts the entire content (body) back at this point. In some cases, this can lead to the problem that the body is inserted again at a point in the body. This results in nesting within the website.
If you also think this is a problem you could use preg_replace_callback instead of preg_replace in function setBody.
(vendor/in2code/in2glossar/Classes/EventListener/ContentPostProcessor.php)
You could replace
protected function setBody(string $body): void
{
$this->tsfe->content = preg_replace(
'/(<body[^>]*>)(.*)(<\/body>)/Uims',
'$1' . $body . '$3',
$this->tsfe->content,
);
}
with
protected function setBody(string $body): void
{
$this->tsfe->content = preg_replace_callback(
'/(<body[^>]*>)(.*)(<\/body>)/Uims',
function ($matches) use ($body) {
return $matches[1] . $body . $matches[3];
},
$this->tsfe->content
);
}
Metadata
Metadata
Assignees
Labels
No labels