mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
add error message for empty if/elseif statements
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- add error message for empty if/elseif statements (eykanal,
|
||||
monte)
|
||||
- cast selected value to string for comparison in html_radios
|
||||
(Exeption, monte)
|
||||
- updated html_select_date's year_as_text-feature to be xhtml compliant
|
||||
|
@@ -1250,6 +1250,13 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
$tokens = $match[0];
|
||||
|
||||
if(empty($tokens)) {
|
||||
$_error_msg .= $elseif ? "'elseif'" : "'if'";
|
||||
$_error_msg .= ' statement requires arguments';
|
||||
$this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
|
||||
// make sure we have balanced parenthesis
|
||||
$token_count = array_count_values($tokens);
|
||||
if(isset($token_count['(']) && $token_count['('] != $token_count[')']) {
|
||||
|
Reference in New Issue
Block a user