- bugfix compiling super globals like {$smarty.get.foo} did fail in the master branch https://github.com/smarty-php/smarty/issues/77

This commit is contained in:
uwetews
2015-08-23 16:59:34 +02:00
parent 9fd0b3086d
commit 0e4039f5c0
2 changed files with 11 additions and 3 deletions

View File

@@ -14,7 +14,8 @@
- optimize use_include_path processing
- relocate properties for size optimization
- remove redundant code
- bugfix compiling super globals like {$smarty.get.foo} did fail in the master branch https://github.com/smarty-php/smarty/issues/77
06.08.2015
- avoid possible circular object references caused by parser/lexer objects
- rewrite compileAll... utility methods

View File

@@ -67,7 +67,8 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
$compiler->trigger_template_error("(secure mode) super globals not permitted");
break;
}
return '$_' . strtoupper($variable);
$compiled_ref = '$_' . strtoupper($variable);
break;
break;
case 'template':
@@ -117,7 +118,13 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
$compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid');
break;
}
if (isset($_index[1])) {
array_shift($_index);
foreach ($_index as $_ind) {
$compiled_ref = $compiled_ref . "[$_ind]";
}
}
return $compiled_ref;
}
return '';
}
}