diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-12-18 11:33:34 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-12-18 11:33:34 +0100 |
commit | 84bf7058119bb2ed48358678be9c212a66c8cb83 (patch) | |
tree | 7ec4285b6b62fdfbc5f518fac516a0dacce79293 /library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php | |
parent | 1b9722c65ac2169cadcf78376aaaf9d82721c9cd (diff) | |
download | volse-hubzilla-84bf7058119bb2ed48358678be9c212a66c8cb83.tar.gz volse-hubzilla-84bf7058119bb2ed48358678be9c212a66c8cb83.tar.bz2 volse-hubzilla-84bf7058119bb2ed48358678be9c212a66c8cb83.zip |
update smarty to 3.1.28 stable
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php index 25b35e861..50c25bdb6 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -206,16 +206,15 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com */ public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { - // make all lower case - $parameter = array_map('strtolower', $parameter); - $tag = trim($parameter[0], '"\''); - if (!isset($parameter[1]) || false === $name = $compiler->getId($parameter[1])) { + $tag = strtolower(trim($parameter[ 0 ], '"\'')); + $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false; + if (!$name) { $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); } + /* @var Smarty_Internal_Compile_Foreach|Smarty_Internal_Compile_Section $className */ $className = 'Smarty_Internal_Compile_' . ucfirst($tag); - if ((!isset($parameter[2]) || false === $property = $compiler->getId($parameter[2])) || - !in_array($property, $className::$nameProperties) - ) { + $property = isset($parameter[ 2 ]) ? strtolower($compiler->getId($parameter[ 2 ])) : false; + if (!$property || !in_array($property, $className::$nameProperties)) { $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} property attribute", null, true); } $tagVar = "'__smarty_{$tag}_{$name}'"; |