add error message for empty if/elseif statements

This commit is contained in:
mohrt
2005-05-02 14:03:18 +00:00
parent 672c55f003
commit bd60de4b42
2 changed files with 9 additions and 0 deletions

2
NEWS
View File

@@ -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

View File

@@ -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[')']) {