treat undefined constants as null

This commit is contained in:
mohrt
2003-02-05 23:22:39 +00:00
parent 0ce1799133
commit 8705ecd41a
3 changed files with 3 additions and 8 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- treat undefined constants as null (Ferdinand Beyer, Monte)
- fix problem with inserts and nested fetches - fix problem with inserts and nested fetches
(Rainer Collet, Monte) (Rainer Collet, Monte)
- added support for passing params to include_php - added support for passing params to include_php

View File

@@ -1774,10 +1774,7 @@ class Smarty_Compiler extends Smarty {
case 'const': case 'const':
array_shift($indexes); array_shift($indexes);
if(!defined(substr($indexes[0],1))) { $compiled_ref = 'defined(' . substr($indexes[0],1) . ') ? ' . substr($indexes[0],1) . ' : null';
$this->_syntax_error('$smarty' . implode('', $indexes) .' is an undefined constant', E_USER_ERROR, __FILE__, __LINE__);
}
$compiled_ref = substr($indexes[0],1);
break; break;
default: default:

View File

@@ -1774,10 +1774,7 @@ class Smarty_Compiler extends Smarty {
case 'const': case 'const':
array_shift($indexes); array_shift($indexes);
if(!defined(substr($indexes[0],1))) { $compiled_ref = 'defined(' . substr($indexes[0],1) . ') ? ' . substr($indexes[0],1) . ' : null';
$this->_syntax_error('$smarty' . implode('', $indexes) .' is an undefined constant', E_USER_ERROR, __FILE__, __LINE__);
}
$compiled_ref = substr($indexes[0],1);
break; break;
default: default: