mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +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
|
- 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
|
||||||
|
@@ -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:
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user