cvs: smarty /libs Smarty_Compiler.class.php /libs/core core.write_file.php /libs/plugins function.html_image.php
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1056987685@cvsserver> |
messju Mon Jun 30 11:41:25 2003 EDT
Modified files:
/smarty/libs Smarty_Compiler.class.php
/smarty/libs/core core.write_file.php
/smarty/libs/plugins function.html_image.php
Log:
libs/plugins/function.html_image.php
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.256 smarty/libs/Smarty_Compiler.class.php:1.257
--- smarty/libs/Smarty_Compiler.class.php:1.256 Mon Jun 30 11:08:59 2003
+++ smarty/libs/Smarty_Compiler.class.php Mon Jun 30 11:41:24 2003
@@ -39,7 +39,7 @@
* @package Smarty
*/
-/* $Id: Smarty_Compiler.class.php,v 1.256 2003/06/30 15:08:59 messju Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.257 2003/06/30 15:41:24 messju Exp $ */
/**
* Template compiling class
* @package Smarty
@@ -1606,7 +1606,7 @@
}
// get [foo] and .foo and ->foo and (...) pieces
- preg_match_all('!(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\w+|\.\$?\w+|\S+!', $_var_ref, $match);
+ preg_match_all('!(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+!', $_var_ref, $match);
$_indexes = $match[0];
$_var_name = array_shift($_indexes);
@@ -1635,7 +1635,7 @@
} else {
$_output = "\$this->_tpl_vars['$_var_name']";
}
-
+
foreach ($_indexes as $_index) {
if ($_index{0} == '[') {
$_index = substr($_index, 1, -1);
@@ -1659,8 +1659,15 @@
$this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
} elseif($this->security && substr($_index, 2, 1) == '_') {
$this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
- }
- $_output .= $_index;
+ } elseif ($_index{2} == '$') {
+ if ($this->security) {
+ $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+ } else {
+ $_output .= '->{$this->_tpl_vars[\''.substr($_index,3).'\']}';
+ }
+ } else {
+ $_output .= $_index;
+ }
} elseif ($_index{0} == '(') {
$_index = $this->_parse_parenth_args($_index);
$_output .= $_index;
Index: smarty/libs/core/core.write_file.php
diff -u smarty/libs/core/core.write_file.php:1.4 smarty/libs/core/core.write_file.php:1.5
--- smarty/libs/core/core.write_file.php:1.4 Sat Jun 21 23:13:25 2003
+++ smarty/libs/core/core.write_file.php Mon Jun 30 11:41:25 2003
@@ -38,7 +38,7 @@
@unlink($params['filename']);
}
@rename($_tmp_file, $params['filename']);
- chmod($params['filename'], $smarty->_file_perms);
+ @chmod($params['filename'], $smarty->_file_perms);
return true;
}
Index: smarty/libs/plugins/function.html_image.php
diff -u smarty/libs/plugins/function.html_image.php:1.21 smarty/libs/plugins/function.html_image.php:1.22
--- smarty/libs/plugins/function.html_image.php:1.21 Tue Jun 24 11:28:22 2003
+++ smarty/libs/plugins/function.html_image.php Mon Jun 30 11:41:25 2003
@@ -94,7 +94,7 @@
return;
}
- if(substr($file,0,1) == DIRECTORY_SEPARATOR) {
+ if (substr($file,0,1) == '/') {
$_image_path = $basedir . $file;
} else {
$_image_path = $file;
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php