Remove nodouble option and make it the default behavior

This commit is contained in:
Kijin Sung 2015-02-16 20:09:17 +09:00
parent bd365c7ff1
commit d0addddbec

View file

@ -602,7 +602,7 @@ class TemplateHandler
else
{
$escape_option = $this->config->autoescape !== null ? 'auto' : 'noescape';
if(preg_match('@^(.+)\\|((?:no)?escape|nodouble)$@', $m[1], $mm))
if(preg_match('@^(.+)\\|((?:no)?escape)$@', $m[1], $mm))
{
$m[1] = $mm[1];
$escape_option = $mm[2];
@ -611,13 +611,11 @@ class TemplateHandler
switch($escape_option)
{
case 'auto':
return "<?php echo (\$this->config->autoescape === 'on' ? htmlspecialchars({$m[1]}, ENT_COMPAT, 'UTF-8', true) : {$m[1]}) ?>";
return "<?php echo (\$this->config->autoescape === 'on' ? htmlspecialchars({$m[1]}, ENT_COMPAT, 'UTF-8', false) : {$m[1]}) ?>";
case 'escape':
return "<?php echo htmlspecialchars({$m[1]}, ENT_COMPAT, 'UTF-8', true) ?>";
case 'noescape':
return "<?php echo {$m[1]} ?>";
case 'nodouble':
return "<?php echo htmlspecialchars({$m[1]}, ENT_COMPAT, 'UTF-8', false) ?>";
}
}
}