Fix #2203 'this' in lang directive will refer to current module

This commit is contained in:
Kijin Sung 2023-10-31 21:59:33 +09:00
parent 3233619eac
commit e72336c90c
7 changed files with 69 additions and 6 deletions

View file

@ -720,7 +720,7 @@ class TemplateParser_v2
'json_encode(%s, self::$_json_options) : ' .
'htmlspecialchars(json_encode(%s, self::$_json_options), \ENT_QUOTES, \'UTF-8\', false); ?>', $args, $args);
case 'lang':
return sprintf('<?php echo $this->config->context === \'JS\' ? escape_js(lang(%s)) : lang(%s); ?>', $args, $args);
return sprintf('<?php echo $this->config->context === \'JS\' ? escape_js($this->_v2_lang(%s)) : $this->_v2_lang(%s); ?>', $args, $args);
case 'dump':
return sprintf('<?php ob_start(); var_dump(%s); \$__dump = ob_get_clean(); echo rtrim(\$__dump); ?>', $args);
case 'dd':