mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
change default modifiers to array instead of string
This commit is contained in:
1
NEWS
1
NEWS
@@ -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
|
||||
|
@@ -152,9 +152,9 @@ class Smarty
|
||||
// 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 */
|
||||
|
@@ -1109,9 +1109,9 @@ class Smarty_Compiler extends Smarty {
|
||||
$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);
|
||||
|
@@ -152,9 +152,9 @@ class Smarty
|
||||
// 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 */
|
||||
|
@@ -1109,9 +1109,9 @@ class Smarty_Compiler extends Smarty {
|
||||
$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);
|
||||
|
Reference in New Issue
Block a user