fixed wrong handling of name attribute in {insert}

thanks to Ivan Kravets for reporting this
This commit is contained in:
messju
2006-08-25 19:21:27 +00:00
parent 117173df93
commit c5f0dad3e2
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fix wrong handling of insert's name attribute. (messju)
- fix false replacement of "$t" inside double quotes (checat, messju)
- added support for column headings and caption element to html_table and
updated the output to use thead/tbody elements (boots)

View File

@@ -927,7 +927,11 @@ class Smarty_Compiler extends Smarty {
$name = $this->_dequote($attrs['name']);
if (empty($name)) {
$this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__);
return $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__);
}
if (!preg_match('~^\w+$~', $name)) {
return $this->_syntax_error("'insert: 'name' must be an insert function name", E_USER_ERROR, __FILE__, __LINE__);
}
if (!empty($attrs['script'])) {