From 28f883ca8e046a3a28bb3592aaca6412573d7057 Mon Sep 17 00:00:00 2001 From: "uwe.tews" Date: Thu, 22 Oct 2009 23:05:14 +0000 Subject: [PATCH] - fixed nocache var problem --- change_log.txt | 3 + libs/sysplugins/internal.templateparser.php | 264 ++++++++++---------- 2 files changed, 135 insertions(+), 132 deletions(-) diff --git a/change_log.txt b/change_log.txt index f712d0f3..2bee3d45 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +10/23/2009 +- fixed nocache var problem + 10/22/2009 - fix trimwhitespace outputfilter parameter diff --git a/libs/sysplugins/internal.templateparser.php b/libs/sysplugins/internal.templateparser.php index c771eeca..d7accc17 100644 --- a/libs/sysplugins/internal.templateparser.php +++ b/libs/sysplugins/internal.templateparser.php @@ -109,38 +109,38 @@ class Smarty_Internal_Templateparser#line 109 "internal.templateparser.php" /* First off, code is included which follows the "include_class" declaration ** in the input file. */ #line 14 "internal.templateparser.y" - - // states whether the parse was successful or not - public $successful = true; - public $retvalue = 0; - private $lex; - private $internalError = false; - - function __construct($lex, $compiler) { - // set instance object - self::instance($this); - $this->lex = $lex; - $this->compiler = $compiler; - $this->smarty = $this->compiler->smarty; - $this->template = $this->compiler->template; - if ($this->template->security && isset($this->smarty->security_handler)) { - $this->sec_obj = $this->smarty->security_policy; - } else { - $this->sec_obj = $this->smarty; - } - $this->cacher = $this->template->cacher_object; - $this->compiler->has_variable_string = false; - $this->compiler->prefix_code = array(); - $this->prefix_number = 0; - } - public static function &instance($new_instance = null) - { - static $instance = null; - if (isset($new_instance) && is_object($new_instance)) - $instance = $new_instance; - return $instance; - } - + + // states whether the parse was successful or not + public $successful = true; + public $retvalue = 0; + private $lex; + private $internalError = false; + + function __construct($lex, $compiler) { + // set instance object + self::instance($this); + $this->lex = $lex; + $this->compiler = $compiler; + $this->smarty = $this->compiler->smarty; + $this->template = $this->compiler->template; + if ($this->template->security && isset($this->smarty->security_handler)) { + $this->sec_obj = $this->smarty->security_policy; + } else { + $this->sec_obj = $this->smarty; + } + $this->cacher = $this->template->cacher_object; + $this->compiler->has_variable_string = false; + $this->compiler->prefix_code = array(); + $this->prefix_number = 0; + } + public static function &instance($new_instance = null) + { + static $instance = null; + if (isset($new_instance) && is_object($new_instance)) + $instance = $new_instance; + return $instance; + } + #line 147 "internal.templateparser.php" /* Next is all token values, as class constants @@ -1991,17 +1991,17 @@ static public $yy_action = array( function yy_r2(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } #line 1997 "internal.templateparser.php" #line 93 "internal.templateparser.y" - function yy_r3(){preg_match('/\s*/',$this->yystack[$this->yyidx + -2]->minor,$s); - if ($this->compiler->has_code) { - $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); - $this->_retvalue = $this->cacher->processNocacheCode($tmp.$s[0].$this->yystack[$this->yyidx + -1]->minor, $this->compiler,true); + function yy_r3(){preg_match('/\s*/',$this->yystack[$this->yyidx + -2]->minor,$s); + if ($this->compiler->has_code) { + $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); + $this->_retvalue = $this->cacher->processNocacheCode($tmp.$s[0].$this->yystack[$this->yyidx + -1]->minor, $this->compiler,true); } else { $this->_retvalue = $s[0].$this->yystack[$this->yyidx + -1]->minor;} $this->compiler->has_variable_string = false; } #line 2004 "internal.templateparser.php" #line 99 "internal.templateparser.y" - function yy_r4(){preg_match('/\s*/',$this->yystack[$this->yyidx + -2]->minor,$s); - if ($this->compiler->has_code) { - $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); - $this->_retvalue = $this->cacher->processNocacheCode($tmp.$s[0].$this->yystack[$this->yyidx + -1]->minor, $this->compiler,true); + function yy_r4(){preg_match('/\s*/',$this->yystack[$this->yyidx + -2]->minor,$s); + if ($this->compiler->has_code) { + $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); + $this->_retvalue = $this->cacher->processNocacheCode($tmp.$s[0].$this->yystack[$this->yyidx + -1]->minor, $this->compiler,true); } else { $this->_retvalue = $s[0].$this->yystack[$this->yyidx + -1]->minor;} $this->compiler->has_variable_string = false; } #line 2011 "internal.templateparser.php" #line 111 "internal.templateparser.y" @@ -2017,26 +2017,26 @@ static public $yy_action = array( function yy_r9(){preg_match('/\s*/',$this->yystack[$this->yyidx + 0]->minor,$s); $this->_retvalue = $s[0].$this->cacher->processNocacheCode($this->smarty->right_delimiter, $this->compiler,false); } #line 2023 "internal.templateparser.php" #line 120 "internal.templateparser.y" - function yy_r10(){if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { - $this->_retvalue = $this->cacher->processNocacheCode("yystack[$this->yyidx + -1]->minor)."?>';?>\n", $this->compiler, false); - } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { - $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false); - }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { - $this->_retvalue = $this->cacher->processNocacheCode('yystack[$this->yyidx + -1]->minor.'?>', $this->compiler, true); - }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) { - $this->_retvalue = ''; - } + function yy_r10(){if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { + $this->_retvalue = $this->cacher->processNocacheCode("yystack[$this->yyidx + -1]->minor)."?>';?>\n", $this->compiler, false); + } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { + $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false); + }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { + $this->_retvalue = $this->cacher->processNocacheCode('yystack[$this->yyidx + -1]->minor.'?>', $this->compiler, true); + }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) { + $this->_retvalue = ''; + } } #line 2035 "internal.templateparser.php" #line 131 "internal.templateparser.y" - function yy_r11(){preg_match('/\s*/',$this->yystack[$this->yyidx + -3]->minor,$s); $this->_retvalue = $s[0]; - if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU || $this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { - $this->_retvalue .= $this->cacher->processNocacheCode("yystack[$this->yyidx + -1]->minor."?>'?>\n", $this->compiler, false); - } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { - $this->_retvalue .= $this->cacher->processNocacheCode(htmlspecialchars('yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false); - }elseif ($this->sec_obj == SMARTY_PHP_REMOVE) { - $this->_retvalue .= ''; - } + function yy_r11(){preg_match('/\s*/',$this->yystack[$this->yyidx + -3]->minor,$s); $this->_retvalue = $s[0]; + if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU || $this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { + $this->_retvalue .= $this->cacher->processNocacheCode("yystack[$this->yyidx + -1]->minor."?>'?>\n", $this->compiler, false); + } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { + $this->_retvalue .= $this->cacher->processNocacheCode(htmlspecialchars('yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false); + }elseif ($this->sec_obj == SMARTY_PHP_REMOVE) { + $this->_retvalue .= ''; + } } #line 2046 "internal.templateparser.php" #line 142 "internal.templateparser.y" @@ -2061,37 +2061,37 @@ static public $yy_action = array( function yy_r21(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,array_merge(array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor),$this->yystack[$this->yyidx + 0]->minor)); } #line 2067 "internal.templateparser.php" #line 169 "internal.templateparser.y" - function yy_r22(){ $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + 0]->minor).'smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -2]->minor[0],'modifier')) { - $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; - } else { - if (is_callable($this->yystack[$this->yyidx + -2]->minor[0])) { - if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -2]->minor[0], $this->compiler)) { - $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; - } - } else { - $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -2]->minor[0] . "\""); - } - } + function yy_r22(){ $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + 0]->minor).'smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -2]->minor[0],'modifier')) { + $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; + } else { + if (is_callable($this->yystack[$this->yyidx + -2]->minor[0])) { + if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -2]->minor[0], $this->compiler)) { + $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; + } + } else { + $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -2]->minor[0] . "\""); + } + } } #line 2082 "internal.templateparser.php" #line 183 "internal.templateparser.y" - function yy_r23(){if (!in_array($this->yystack[$this->yyidx + -2]->minor,array('if','elseif','while'))) { - $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -2]->minor . "\""); - } + function yy_r23(){if (!in_array($this->yystack[$this->yyidx + -2]->minor,array('if','elseif','while'))) { + $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -2]->minor . "\""); + } $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); } #line 2088 "internal.templateparser.php" #line 187 "internal.templateparser.y" - function yy_r24(){ if (!in_array($this->yystack[$this->yyidx + -2]->minor,array('if','elseif','while'))) { - $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -2]->minor . "\""); - } + function yy_r24(){ if (!in_array($this->yystack[$this->yyidx + -2]->minor,array('if','elseif','while'))) { + $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -2]->minor . "\""); + } $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); } #line 2094 "internal.templateparser.php" #line 192 "internal.templateparser.y" - function yy_r25(){ - if ($this->yystack[$this->yyidx + -8]->minor != 'for') { - $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -8]->minor . "\""); - } + function yy_r25(){ + if ($this->yystack[$this->yyidx + -8]->minor != 'for') { + $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -8]->minor . "\""); + } $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -8]->minor,array('start'=>$this->yystack[$this->yyidx + -6]->minor,'ifexp'=>$this->yystack[$this->yyidx + -4]->minor,'varloop'=>$this->yystack[$this->yyidx + -1]->minor,'loop'=>$this->yystack[$this->yyidx + 0]->minor)); } #line 2101 "internal.templateparser.php" #line 197 "internal.templateparser.y" @@ -2101,35 +2101,35 @@ static public $yy_action = array( function yy_r27(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } #line 2107 "internal.templateparser.php" #line 200 "internal.templateparser.y" - function yy_r28(){ - if ($this->yystack[$this->yyidx + -5]->minor != 'foreach') { - $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -5]->minor . "\""); - } + function yy_r28(){ + if ($this->yystack[$this->yyidx + -5]->minor != 'foreach') { + $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -5]->minor . "\""); + } $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,array('from'=>$this->yystack[$this->yyidx + -3]->minor,'item'=>$this->yystack[$this->yyidx + 0]->minor)); } #line 2114 "internal.templateparser.php" #line 205 "internal.templateparser.y" - function yy_r29(){ - if ($this->yystack[$this->yyidx + -5]->minor != 'foreach') { - $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -5]->minor . "\""); - } + function yy_r29(){ + if ($this->yystack[$this->yyidx + -5]->minor != 'foreach') { + $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -5]->minor . "\""); + } $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,array('from'=>$this->yystack[$this->yyidx + -3]->minor,'item'=>$this->yystack[$this->yyidx + 0]->minor)); } #line 2121 "internal.templateparser.php" #line 212 "internal.templateparser.y" function yy_r30(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',$this->yystack[$this->yyidx + 0]->minor); } #line 2124 "internal.templateparser.php" #line 213 "internal.templateparser.y" - function yy_r31(){ $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',$this->yystack[$this->yyidx + 0]->minor).'smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -2]->minor[0],'modifier')) { - $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; - } else { - if (is_callable($this->yystack[$this->yyidx + -2]->minor[0])) { - if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -2]->minor[0], $this->compiler)) { - $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; - } - } else { - $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -2]->minor[0] . "\""); - } - } + function yy_r31(){ $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',$this->yystack[$this->yyidx + 0]->minor).'smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -2]->minor[0],'modifier')) { + $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; + } else { + if (is_callable($this->yystack[$this->yyidx + -2]->minor[0])) { + if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -2]->minor[0], $this->compiler)) { + $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -2]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -1]->minor. "),".$this->yystack[$this->yyidx + -2]->minor[1].");?>"; + } + } else { + $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -2]->minor[0] . "\""); + } + } } #line 2139 "internal.templateparser.php" #line 227 "internal.templateparser.y" @@ -2163,18 +2163,18 @@ static public $yy_action = array( function yy_r44(){$this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; } #line 2169 "internal.templateparser.php" #line 261 "internal.templateparser.y" - function yy_r45(){ - if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -1]->minor[0],'modifier')) { - $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")"; - } else { - if (is_callable($this->yystack[$this->yyidx + -1]->minor[0])) { - if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -1]->minor[0], $this->compiler)) { - $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")"; - } - } else { - $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -1]->minor[0] . "\""); - } - } + function yy_r45(){ + if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -1]->minor[0],'modifier')) { + $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")"; + } else { + if (is_callable($this->yystack[$this->yyidx + -1]->minor[0])) { + if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -1]->minor[0], $this->compiler)) { + $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")"; + } + } else { + $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -1]->minor[0] . "\""); + } + } } #line 2184 "internal.templateparser.php" #line 278 "internal.templateparser.y" @@ -2229,11 +2229,11 @@ static public $yy_action = array( function yy_r74(){ $this->prefix_number++; $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + -1]->minor.'prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; } #line 2235 "internal.templateparser.php" #line 345 "internal.templateparser.y" - function yy_r75(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('internal_smarty_var',$this->yystack[$this->yyidx + 0]->minor['index']);} else { - $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"))->nocache;} } + function yy_r75(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('internal_smarty_var',$this->yystack[$this->yyidx + 0]->minor['index']);} else { + $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"))->nocache;} } #line 2239 "internal.templateparser.php" #line 348 "internal.templateparser.y" - function yy_r76(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"))->nocache; } + function yy_r76(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"))->nocache; } #line 2242 "internal.templateparser.php" #line 352 "internal.templateparser.y" function yy_r78(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; } @@ -2278,8 +2278,8 @@ static public $yy_action = array( function yy_r94(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } #line 2284 "internal.templateparser.php" #line 395 "internal.templateparser.y" - function yy_r95(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('internal_smarty_var',$this->yystack[$this->yyidx + -1]->minor['index']).$this->yystack[$this->yyidx + 0]->minor;} else { - $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"))->nocache;} } + function yy_r95(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('internal_smarty_var',$this->yystack[$this->yyidx + -1]->minor['index']).$this->yystack[$this->yyidx + 0]->minor;} else { + $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"))->nocache;} } #line 2288 "internal.templateparser.php" #line 398 "internal.templateparser.y" function yy_r96(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } @@ -2303,12 +2303,12 @@ static public $yy_action = array( function yy_r102(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } #line 2309 "internal.templateparser.php" #line 413 "internal.templateparser.y" - function yy_r103(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { - if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) { - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")"; - } else { - $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); - } + function yy_r103(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { + if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) { + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")"; + } else { + $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); + } } } #line 2318 "internal.templateparser.php" #line 424 "internal.templateparser.y" @@ -2426,7 +2426,7 @@ static public $yy_action = array( function yy_r155(){$this->_retvalue = '".'.$this->yystack[$this->yyidx + -1]->minor.'."'; $this->compiler->has_variable_string = true; } #line 2432 "internal.templateparser.php" #line 518 "internal.templateparser.y" - function yy_r156(){$this->_retvalue = '".'.'$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + 0]->minor .'\')->value'.'."'; $this->compiler->tag_nocache=$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"))->nocache; $this->compiler->has_variable_string = true; } + function yy_r156(){$this->_retvalue = '".'.'$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + 0]->minor .'\')->value'.'."'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"))->nocache; $this->compiler->has_variable_string = true; } #line 2435 "internal.templateparser.php" #line 519 "internal.templateparser.y" function yy_r157(){preg_match('/\s*/',$this->yystack[$this->yyidx + -2]->minor,$s); $this->_retvalue = $s[0].'".('.$this->yystack[$this->yyidx + -1]->minor.')."'; $this->compiler->has_variable_string = true; } @@ -2552,10 +2552,10 @@ static public $yy_action = array( function yy_syntax_error($yymajor, $TOKEN) { #line 60 "internal.templateparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); #line 2565 "internal.templateparser.php" } @@ -2575,11 +2575,11 @@ static public $yy_action = array( /* Here code is inserted which will be executed whenever the ** parser accepts */ #line 52 "internal.templateparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - //echo $this->retvalue."\n\n"; + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + //echo $this->retvalue."\n\n"; #line 2590 "internal.templateparser.php" }