cvs: smarty /libs Smarty_Compiler.class.php
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1061198882@cvsserver> |
messju Mon Aug 18 05:28:02 2003 EDT
Modified files:
/smarty/libs Smarty_Compiler.class.php
Log:
allow section-, array- and object-dereference in $smarty-references
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.275 smarty/libs/Smarty_Compiler.class.php:1.276
--- smarty/libs/Smarty_Compiler.class.php:1.275 Mon Aug 11 11:55:39 2003
+++ smarty/libs/Smarty_Compiler.class.php Mon Aug 18 05:28:02 2003
@@ -39,7 +39,7 @@
* @package Smarty
*/
-/* $Id: Smarty_Compiler.class.php,v 1.275 2003/08/11 15:55:39 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.276 2003/08/18 09:28:02 messju Exp $ */
/**
* Template compiling class
@@ -1864,9 +1864,8 @@
{
/* Extract the reference name. */
$_ref = substr($indexes[0], 1);
-
- foreach($indexes as $_index) {
- if ($_index{0} != '.') {
+ foreach($indexes as $_index_no=>$_index) {
+ if ($_index{0} != '.' && $_index_no<2 || !preg_match('!^(\.|\[|->)!', $_index)) {
$this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
}
}
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php