diff --git a/NEWS b/NEWS index c587fa99..8778283d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - support $smarty.const.$foo syntax (messju, Monte) - remove E_NOTICE warnings from debug.tpl, escape modifier (Kanstantin, Monte) - don't count non-ascii chars in count_words modifier diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 8bfc98b5..d283fede 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -1780,7 +1780,7 @@ class Smarty_Compiler extends Smarty { case 'const': array_shift($indexes); - $compiled_ref = '(defined(\'' . substr($indexes[0],1) . '\') ? ' . substr($indexes[0],1) . ' : null)'; + $compiled_ref = '(defined("' . substr($indexes[0],1) . '") ? ' . substr($indexes[0],1) . ' : null)'; break; default: diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 8bfc98b5..d283fede 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1780,7 +1780,7 @@ class Smarty_Compiler extends Smarty { case 'const': array_shift($indexes); - $compiled_ref = '(defined(\'' . substr($indexes[0],1) . '\') ? ' . substr($indexes[0],1) . ' : null)'; + $compiled_ref = '(defined("' . substr($indexes[0],1) . '") ? ' . substr($indexes[0],1) . ' : null)'; break; default: