Commit 616ab034 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(core) Fix infinite loop

issue #5882
Showing with 4 additions and 2 deletions
+4 -2
......@@ -229,10 +229,12 @@ class templateHandling
return preg_replace('/^%%/', '', $string);
}
$vars = array();
while (preg_match('/%([^%]+)%/', $string, $m, PREG_OFFSET_CAPTURE)) {
$offset = 0;
$vars = array();
while (preg_match('/%([^%]+)%/', $string, $m, PREG_OFFSET_CAPTURE, $offset)) {
$replace = static::parseMask($m[1][0], $attrs);
$vars[] = array($m[0][1], strlen($m[0][0]), $replace);
$offset = $m[0][1] + strlen($m[0][0]);
}
$generator = static::iteratePossibleValues($string, $vars, $escapeMethod);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment