minor fix

This commit is contained in:
Uwe Tews
2015-05-23 22:40:24 +02:00
parent aa1e554993
commit 0356b70578

View File

@@ -43,13 +43,13 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
if ($_attr['type'] == 'xml') { if ($_attr['type'] == 'xml') {
$compiler->tag_nocache = true; $compiler->tag_nocache = true;
$save = $compiler->template->has_nocache_code; $save = $compiler->template->has_nocache_code;
$compiler->template->has_nocache_code = $save;
$output = addcslashes($_attr['code'], "'\\"); $output = addcslashes($_attr['code'], "'\\");
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true))); $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true)));
$compiler->template->has_nocache_code = $save;
return ''; return '';
} }
if ($_attr['type'] != 'tag') { if ($_attr['type'] != 'tag') {
if ($compiler->php_handling == Smarty::PHP_REMOVE) { if ($compiler->php_handling == Smarty::PHP_REMOVE) {
return ''; return '';
} elseif ($compiler->php_handling == Smarty::PHP_QUOTE) { } elseif ($compiler->php_handling == Smarty::PHP_QUOTE) {
$output = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this, $output = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this,
@@ -59,9 +59,9 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
} elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr['type'] == 'unmatched') { } elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr['type'] == 'unmatched') {
$compiler->tag_nocache = true; $compiler->tag_nocache = true;
$save = $compiler->template->has_nocache_code; $save = $compiler->template->has_nocache_code;
$compiler->template->has_nocache_code = $save;
$output = addcslashes($_attr['code'], "'\\"); $output = addcslashes($_attr['code'], "'\\");
$compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true))); $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true)));
$compiler->template->has_nocache_code = $save;
return ''; return '';
} elseif ($compiler->php_handling == Smarty::PHP_ALLOW) { } elseif ($compiler->php_handling == Smarty::PHP_ALLOW) {
if (!($compiler->smarty instanceof SmartyBC)) { if (!($compiler->smarty instanceof SmartyBC)) {