fixed occasional wrong error messages on mismatched tags when

{else}, {elseif}, {foreachelse} or {sectionelse} is involved

thanks to Ooypunk for pointing me on this
This commit is contained in:
messju
2004-08-12 21:07:24 +00:00
parent e4a075bd03
commit 6217c69fb1
2 changed files with 11 additions and 4 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- fix occasional wrong error messages on mismatched tags when
{else}, {elseif}, {foreachelse} or {sectionelse} is involved (messju)
- fix handling of methods arguments (messju, Manfred Wischin)
- remove touch() call that made the compiled-template's timestamp the
same as the source-template's one. (messju)

View File

@@ -2205,12 +2205,17 @@ class Smarty_Compiler extends Smarty {
return $this->_pop_tag($close_tag);
}
if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
$this->_pop_tag($close_tag);
return $_open_tag;
return $this->_pop_tag($close_tag);
}
if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') {
$this->_pop_tag($close_tag);
return $_open_tag;
return $this->_pop_tag($close_tag);
}
if ($_open_tag == 'else' || $_open_tag == 'elseif') {
$_open_tag = 'if';
} elseif ($_open_tag == 'sectionelse') {
$_open_tag = 'section';
} elseif ($_open_tag == 'foreachelse') {
$_open_tag = 'foreach';
}
$message = " expected {/$_open_tag} (opened line $_line_no).";
}