support $smarty.const.$foo syntax

This commit is contained in:
mohrt
2003-02-17 15:04:43 +00:00
parent c99f9fdbb2
commit 021c83db3f
3 changed files with 3 additions and 2 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- support $smarty.const.$foo syntax (messju, Monte)
- remove E_NOTICE warnings from debug.tpl, - remove E_NOTICE warnings from debug.tpl,
escape modifier (Kanstantin, Monte) escape modifier (Kanstantin, Monte)
- don't count non-ascii chars in count_words modifier - don't count non-ascii chars in count_words modifier

View File

@@ -1780,7 +1780,7 @@ class Smarty_Compiler extends Smarty {
case 'const': case 'const':
array_shift($indexes); 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; break;
default: default:

View File

@@ -1780,7 +1780,7 @@ class Smarty_Compiler extends Smarty {
case 'const': case 'const':
array_shift($indexes); 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; break;
default: default: