mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +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)
|
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
|
||||||
- fix filename bug with windows (Gary Loescher, Monte)
|
- fix filename bug with windows (Gary Loescher, Monte)
|
||||||
- add ability to supply expire time in seconds when clearing
|
- add ability to supply expire time in seconds when clearing
|
||||||
|
@@ -152,9 +152,9 @@ class Smarty
|
|||||||
// sub directories are more efficient, but
|
// sub directories are more efficient, but
|
||||||
// you can set this to false if your PHP environment
|
// you can set this to false if your PHP environment
|
||||||
// does not allow the creation of them.
|
// does not allow the creation of them.
|
||||||
var $default_modifiers = '';
|
var $default_modifiers = array();
|
||||||
// modifier string to implicitly append to every var
|
// modifiers to implicitly append to every var
|
||||||
// example: '|escape:"htmlall"'
|
// example: array('escape:"htmlall"');
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* END SMARTY CONFIGURATION SECTION */
|
/* END SMARTY CONFIGURATION SECTION */
|
||||||
|
@@ -1109,9 +1109,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
$var_ref = $parts[0];
|
$var_ref = $parts[0];
|
||||||
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
|
if(!empty($this->default_modifiers) && !strstr('smarty:nodefaults',$modifiers)) {
|
||||||
if(!empty($this->default_modifiers) && !strstr($modifiers,'smarty:nodefaults')) {
|
$_default_mod_string = implode('|',(array)$this->default_modifiers);
|
||||||
$modifiers = empty($modifiers) ? $this->default_modifiers : $this->default_modifiers . '|' . $modifiers;
|
$modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
$modifiers = str_replace(array('smarty:nodefaults','||'),array('','|'),$modifiers);
|
$modifiers = str_replace(array('smarty:nodefaults','||'),array('','|'),$modifiers);
|
||||||
|
@@ -152,9 +152,9 @@ class Smarty
|
|||||||
// sub directories are more efficient, but
|
// sub directories are more efficient, but
|
||||||
// you can set this to false if your PHP environment
|
// you can set this to false if your PHP environment
|
||||||
// does not allow the creation of them.
|
// does not allow the creation of them.
|
||||||
var $default_modifiers = '';
|
var $default_modifiers = array();
|
||||||
// modifier string to implicitly append to every var
|
// modifiers to implicitly append to every var
|
||||||
// example: '|escape:"htmlall"'
|
// example: array('escape:"htmlall"');
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* END SMARTY CONFIGURATION SECTION */
|
/* END SMARTY CONFIGURATION SECTION */
|
||||||
|
@@ -1109,9 +1109,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
$var_ref = $parts[0];
|
$var_ref = $parts[0];
|
||||||
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
$modifiers = isset($parts[1]) ? $parts[1] : '';
|
||||||
|
|
||||||
|
if(!empty($this->default_modifiers) && !strstr('smarty:nodefaults',$modifiers)) {
|
||||||
if(!empty($this->default_modifiers) && !strstr($modifiers,'smarty:nodefaults')) {
|
$_default_mod_string = implode('|',(array)$this->default_modifiers);
|
||||||
$modifiers = empty($modifiers) ? $this->default_modifiers : $this->default_modifiers . '|' . $modifiers;
|
$modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
$modifiers = str_replace(array('smarty:nodefaults','||'),array('','|'),$modifiers);
|
$modifiers = str_replace(array('smarty:nodefaults','||'),array('','|'),$modifiers);
|
||||||
|
Reference in New Issue
Block a user