mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
treat undefined constants as null
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
||||
- treat undefined constants as null (Ferdinand Beyer, Monte)
|
||||
- fix problem with inserts and nested fetches
|
||||
(Rainer Collet, Monte)
|
||||
- added support for passing params to include_php
|
||||
|
@@ -1774,10 +1774,7 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
case 'const':
|
||||
array_shift($indexes);
|
||||
if(!defined(substr($indexes[0],1))) {
|
||||
$this->_syntax_error('$smarty' . implode('', $indexes) .' is an undefined constant', E_USER_ERROR, __FILE__, __LINE__);
|
||||
}
|
||||
$compiled_ref = substr($indexes[0],1);
|
||||
$compiled_ref = 'defined(' . substr($indexes[0],1) . ') ? ' . substr($indexes[0],1) . ' : null';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -1774,10 +1774,7 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
case 'const':
|
||||
array_shift($indexes);
|
||||
if(!defined(substr($indexes[0],1))) {
|
||||
$this->_syntax_error('$smarty' . implode('', $indexes) .' is an undefined constant', E_USER_ERROR, __FILE__, __LINE__);
|
||||
}
|
||||
$compiled_ref = substr($indexes[0],1);
|
||||
$compiled_ref = 'defined(' . substr($indexes[0],1) . ') ? ' . substr($indexes[0],1) . ' : null';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user