mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
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:
2
NEWS
2
NEWS
@@ -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)
|
- fix handling of methods arguments (messju, Manfred Wischin)
|
||||||
- remove touch() call that made the compiled-template's timestamp the
|
- remove touch() call that made the compiled-template's timestamp the
|
||||||
same as the source-template's one. (messju)
|
same as the source-template's one. (messju)
|
||||||
|
@@ -2205,12 +2205,17 @@ class Smarty_Compiler extends Smarty {
|
|||||||
return $this->_pop_tag($close_tag);
|
return $this->_pop_tag($close_tag);
|
||||||
}
|
}
|
||||||
if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
|
if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
|
||||||
$this->_pop_tag($close_tag);
|
return $this->_pop_tag($close_tag);
|
||||||
return $_open_tag;
|
|
||||||
}
|
}
|
||||||
if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') {
|
if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') {
|
||||||
$this->_pop_tag($close_tag);
|
return $this->_pop_tag($close_tag);
|
||||||
return $_open_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).";
|
$message = " expected {/$_open_tag} (opened line $_line_no).";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user