cvs: smarty / NEWS /libs Smarty_Compiler.class.php

[email protected] ("Messju Mohr") Fri, 25 Aug 2006 19:21:27 -0000
Newsgroups php.smarty.cvs
Message-ID <cvsmessju1156533687@cvsserver>
messju		Fri Aug 25 19:21:27 2006 UTC

  Modified files:              
    /smarty	NEWS 
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  fixed wrong handling of name attribute in {insert}
  thanks to Ivan Kravets for reporting this
  
  
http://cvs.php.net/viewvc.cgi/smarty/NEWS?r1=1.538&r2=1.539&diff_format=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.538 smarty/NEWS:1.539
--- smarty/NEWS:1.538	Thu Aug  3 20:03:20 2006
+++ smarty/NEWS	Fri Aug 25 19:21:27 2006
@@ -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)
http://cvs.php.net/viewvc.cgi/smarty/libs/Smarty_Compiler.class.php?r1=1.384&r2=1.385&diff_format=u
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.384 smarty/libs/Smarty_Compiler.class.php:1.385
--- smarty/libs/Smarty_Compiler.class.php:1.384	Fri Aug 25 19:12:16 2006
+++ smarty/libs/Smarty_Compiler.class.php	Fri Aug 25 19:21:27 2006
@@ -26,7 +26,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.384 2006/08/25 19:12:16 messju Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.385 2006/08/25 19:21:27 messju Exp $ */
 
 /**
  * Template compiling class
@@ -927,7 +927,11 @@
         $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'])) {