From 021c83db3f2f22688d4bd41b9e2ee5c28be88e6d Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 17 Feb 2003 15:04:43 +0000 Subject: [PATCH] support $smarty.const.$foo syntax --- NEWS | 1 + Smarty_Compiler.class.php | 2 +- libs/Smarty_Compiler.class.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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: