- Fixed a bug added in previous commit

This commit is contained in:
mcndave committed 2023-02-02 18:12:31 +00:00
1 parent acd9f8c72e
commit e9b2f0ece3
3 files changed
+15 -9

No files matched your search

+9 -8
View File
@@ -22,20 +22,21 @@ class PrintExtension implements Extension {
{
$opt = $context->tokenOptions($token);
switch($token) {
switch($context->tokenName($token)) {
case 'echo':
case 'print':
if (in_array('raw', $opt)) {
return "<?php echo $arguments ?>";
}
return "<?php echo htmlspecialchars((string) $arguments, {$this->flag}, '{$this->encoding}', " . ($this->doubleEncode ? "true" : "false") . ") ?>";
case 'echo.raw':
case "print.raw":
return "<?php echo $arguments ?>";
case 'printf':
return "<?php echo htmlspecialchars(sprintf((string) $arguments), {$this->flag}, '{$this->encoding}', " . ($this->doubleEncode ? "true" : "false") . ") ?>";
if (in_array('raw', $opt)) {
return "<?php printf((string) $arguments) ?>";
}
case 'printf.raw':
return "<?php printf((string) $arguments) ?>";
return "<?php echo htmlspecialchars(sprintf((string) $arguments), {$this->flag}, '{$this->encoding}', " . ($this->doubleEncode ? "true" : "false") . ") ?>";
}
}