mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
In template v2, process escape filters before other filters
This commit is contained in:
parent
3b2fa4208d
commit
f7543e4c9a
2 changed files with 23 additions and 5 deletions
|
|
@ -872,7 +872,16 @@ class TemplateParser_v2
|
|||
$str = $this->_escapeCurly($str);
|
||||
$str = $this->_convertVariableScope($str);
|
||||
|
||||
// Apply filters.
|
||||
// Process the escape option first.
|
||||
foreach ($filters as $filter)
|
||||
{
|
||||
if (in_array($filter, ['autoescape', 'autolang', 'escape', 'noescape']))
|
||||
{
|
||||
$escape_option = $filter;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply other filters.
|
||||
foreach ($filters as $filter)
|
||||
{
|
||||
// Separate the filter option from the filter name.
|
||||
|
|
@ -891,14 +900,13 @@ class TemplateParser_v2
|
|||
}
|
||||
}
|
||||
|
||||
// Apply each filter.
|
||||
// Apply filters.
|
||||
switch ($filter)
|
||||
{
|
||||
case 'autoescape':
|
||||
case 'autolang':
|
||||
case 'escape':
|
||||
case 'noescape':
|
||||
$escape_option = $filter;
|
||||
break;
|
||||
case 'escapejs':
|
||||
case 'js':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue