diff options
author | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-12-11 20:15:27 +0000 |
---|---|---|
committer | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-12-11 20:15:27 +0000 |
commit | 967ab871b836f618107fe144978bd1453c3c6634 (patch) | |
tree | 1bcb1b4bb1b25c904a2bc06f5c6d526d29909eaa /library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php | |
parent | 960c35bad3a0dbaa7a1f2191aef60ad014d926ca (diff) | |
download | volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.gz volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.bz2 volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.zip |
Update Smarty
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php index 0ac3f68ce..caa34861f 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php @@ -1,28 +1,28 @@ <?php /** * Smarty Internal Plugin Compile Assign - * * Compiles the {assign} tag * - * @package Smarty + * @package Smarty * @subpackage Compiler - * @author Uwe Tews + * @author Uwe Tews */ /** * Smarty Internal Plugin Compile Assign Class * - * @package Smarty + * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {assign} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -39,7 +39,11 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase { if ($compiler->tag_nocache || $compiler->nocache) { $_nocache = 'true'; // create nocache var to make it know for further compiling - $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true); + if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) { + $compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true; + } else { + $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true); + } } // scope setup if (isset($_attr['scope'])) { @@ -72,13 +76,11 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase { } elseif ($_scope == Smarty::SCOPE_ROOT || $_scope == Smarty::SCOPE_GLOBAL) { $output .= "\n\$_ptr = \$_smarty_tpl->parent; while (\$_ptr != null) {\$_ptr->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]]; \$_ptr = \$_ptr->parent; }"; } - if ( $_scope == Smarty::SCOPE_GLOBAL) { + if ($_scope == Smarty::SCOPE_GLOBAL) { $output .= "\nSmarty::\$global_tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; } $output .= '?>'; + return $output; } - } - -?>
\ No newline at end of file |