fix constant handling

on undefined constants you get 'TEST_CONST' on definied constants TEST_CONST
This commit is contained in:
Stricted
2015-05-12 15:43:57 +02:00
parent 2ff51de3df
commit 811e2e0e13

View File

@@ -82,7 +82,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
$compiler->trigger_template_error("(secure mode) constants not permitted");
break;
}
if (strpos($_index[1], '$') === false) {
if (strpos($_index[1], '$') === false && strpos($_index[1], '\'')) {
return "@constant('{$_index[1]}')";
} else {
return "@constant({$_index[1]})";