Performance improvement for #513.
This commit is contained in:
parent
7fdc50b6b8
commit
1cd4fbf5ae
@ -356,13 +356,13 @@ class TemplateProcessor
|
|||||||
{
|
{
|
||||||
$fixedDocumentPart = $documentPart;
|
$fixedDocumentPart = $documentPart;
|
||||||
|
|
||||||
$pattern = '|\$\{([^\}]+)\}|U';
|
$fixedDocumentPart = preg_replace_callback(
|
||||||
preg_match_all($pattern, $fixedDocumentPart, $matches);
|
'|\$\{([^\}]+)\}|U',
|
||||||
foreach ($matches[0] as $value) {
|
function ($match) {
|
||||||
$valueCleaned = preg_replace('/<[^>]+>/', '', $value);
|
return strip_tags($match[0]);
|
||||||
$valueCleaned = preg_replace('/<\/[^>]+>/', '', $valueCleaned);
|
},
|
||||||
$fixedDocumentPart = str_replace($value, $valueCleaned, $fixedDocumentPart);
|
$fixedDocumentPart
|
||||||
}
|
);
|
||||||
|
|
||||||
return $fixedDocumentPart;
|
return $fixedDocumentPart;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user