cvs: smarty / NEWS Smarty.class.php Smarty_Compiler.class.php
| From: | Monte Ohrt | Date: | Wed, 17 Jul 2002 21:33:12 +0000 |
| Subject: | cvs: smarty / NEWS Smarty.class.php Smarty_Compiler.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-198@lists.php.net to get a copy of this message | ||
mohrt Wed Jul 17 17:33:12 2002 EDT
Modified files:
/smarty NEWS Smarty.class.php Smarty_Compiler.class.php
Log:
change default modifiers to array instead of string
Index: smarty/NEWS
diff -u smarty/NEWS:1.220 smarty/NEWS:1.221
--- smarty/NEWS:1.220 Wed Jul 17 09:42:29 2002
+++ smarty/NEWS Wed Jul 17 17:33:12 2002
@@ -1,3 +1,4 @@
+ - add default modifier logic (Monte)
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
- fix filename bug with windows (Gary Loescher, Monte)
- add ability to supply expire time in seconds when clearing
Index: smarty/Smarty.class.php
diff -u smarty/Smarty.class.php:1.307 smarty/Smarty.class.php:1.308
--- smarty/Smarty.class.php:1.307 Wed Jul 17 17:16:42 2002
+++ smarty/Smarty.class.php Wed Jul 17 17:33:12 2002
@@ -152,9 +152,9 @@
// sub directories are more efficient, but
// you can set this to false if your PHP environment
// does not allow the creation of them.
- var $default_modifiers = '';
- // modifier string to implicitly append to every var
- // example: '|escape:"htmlall"'
+ var $default_modifiers = array();
+ // modifiers to implicitly append to every var
+ // example: array('escape:"htmlall"');
/**************************************************************************/
/* END SMARTY CONFIGURATION SECTION */
Index: smarty/Smarty_Compiler.class.php
diff -u smarty/Smarty_Compiler.class.php:1.121 smarty/Smarty_Compiler.class.php:1.122
--- smarty/Smarty_Compiler.class.php:1.121 Wed Jul 17 17:16:43 2002
+++ smarty/Smarty_Compiler.class.php Wed Jul 17 17:33:12 2002
@@ -1109,9 +1109,9 @@
$var_ref = $parts[0];
$modifiers = isset($parts[1]) ? $parts[1] : '';
-
- if(!empty($this->default_modifiers) &&
!strstr($modifiers,'smarty:nodefaults')) {
- $modifiers = empty($modifiers) ? $this->default_modifiers : $this->default_modifiers .
'|' . $modifiers;
+ if(!empty($this->default_modifiers) &&
!strstr('smarty:nodefaults',$modifiers)) {
+ $_default_mod_string = implode('|',(array)$this->default_modifiers);
+ $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' .
$modifiers;
}
$modifiers =
str_replace(array('smarty:nodefaults','||'),array('','|'),$modifiers);