mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 23:03:25 +09:00
Change behavior of 'autoescape' filter to always escape (but not double-escape)
This commit is contained in:
parent
7fd0f5df7b
commit
5638207fb0
2 changed files with 12 additions and 3 deletions
|
|
@ -315,9 +315,17 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
|
|||
PHP_EOL . '$this->config->autoescape = \'on\';' . "\n" . 'echo ($this->config->autoescape === \'on\' ? htmlspecialchars($__Context->foo, ENT_COMPAT, \'UTF-8\', false) : $__Context->foo) ?>'
|
||||
),
|
||||
array(
|
||||
'<config autoescape="off" />{$foo|autoescape}',
|
||||
'<config autoescape="off" />{$foo|auto}',
|
||||
PHP_EOL . '$this->config->autoescape = \'off\';' . "\n" . 'echo ($this->config->autoescape === \'on\' ? htmlspecialchars($__Context->foo, ENT_COMPAT, \'UTF-8\', false) : $__Context->foo) ?>'
|
||||
),
|
||||
array(
|
||||
'<config autoescape="on" />{$foo|autoescape}',
|
||||
PHP_EOL . '$this->config->autoescape = \'on\';' . "\n" . 'echo htmlspecialchars($__Context->foo, ENT_COMPAT, \'UTF-8\', false) ?>'
|
||||
),
|
||||
array(
|
||||
'<config autoescape="off" />{$foo|autoescape}',
|
||||
PHP_EOL . '$this->config->autoescape = \'off\';' . "\n" . 'echo htmlspecialchars($__Context->foo, ENT_COMPAT, \'UTF-8\', false) ?>'
|
||||
),
|
||||
array(
|
||||
'<config autoescape="on" />{$foo|escape}',
|
||||
PHP_EOL . '$this->config->autoescape = \'on\';' . "\n" . 'echo htmlspecialchars($__Context->foo, ENT_COMPAT, \'UTF-8\', true) ?>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue