Improve regexp for template filters

This commit is contained in:
Kijin Sung 2017-02-23 22:25:13 +09:00
parent c4c5fa9e0d
commit f338d38538

View file

@ -565,10 +565,10 @@ class TemplateHandler
}
// Separate filters from variable.
if (preg_match('@^(.+?)(?<![|\s])\\|([a-z].+)$@', $m[1], $mm))
if (preg_match('@^(.+?)(?<![|\s])((?:\|[a-z]{2}[a-z0-9_]+(?::.+)?)+)$@', $m[1], $mm))
{
$m[1] = $mm[1];
$filters = array_map('trim', explode_with_escape('|', $mm[2]));
$filters = array_map('trim', explode_with_escape('|', substr($mm[2], 1)));
}
else
{