mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add JSON_HEX_TAG and JSON_HEX_QUOT to JSON output filter
This commit is contained in:
parent
3c15589fb8
commit
fe804163bf
3 changed files with 16 additions and 16 deletions
|
|
@ -814,8 +814,8 @@ class TemplateParser_v2
|
|||
if ($match[1] === 'json')
|
||||
{
|
||||
return sprintf('<?php echo $this->config->context === \'JS\' ? ' .
|
||||
'json_encode(%s, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES) : ' .
|
||||
'htmlspecialchars(json_encode(%s, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES), \ENT_QUOTES, \'UTF-8\', false); ?>', $args, $args);
|
||||
'json_encode(%s, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES | \JSON_HEX_TAG | \JSON_HEX_QUOT) : ' .
|
||||
'htmlspecialchars(json_encode(%s, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES | \JSON_HEX_TAG | \JSON_HEX_QUOT), \ENT_QUOTES, \'UTF-8\', false); ?>', $args, $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -914,7 +914,7 @@ class TemplateParser_v2
|
|||
$escape_option = 'noescape';
|
||||
break;
|
||||
case 'json':
|
||||
$str = "json_encode({$str}, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)";
|
||||
$str = "json_encode({$str}, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES | \JSON_HEX_TAG | \JSON_HEX_QUOT)";
|
||||
$escape_option = 'autocontext';
|
||||
break;
|
||||
case 'strip':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue