Smarty v4 update to v4.5.1
This commit is contained in:
@@ -107,7 +107,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '4.4.1';
|
const SMARTY_VERSION = '4.5.1';
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -109,9 +109,11 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
|
|||||||
if (!is_object($compiler->smarty->security_policy)
|
if (!is_object($compiler->smarty->security_policy)
|
||||||
|| $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)
|
|| $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)
|
||||||
) {
|
) {
|
||||||
trigger_error('Using php-function "' . $modifier . '" as a modifier is deprecated and will be ' .
|
if (!in_array($modifier, ['time', 'join', 'is_array', 'in_array'])) {
|
||||||
|
trigger_error('Using unregistered function "' . $modifier . '" in a template is deprecated and will be ' .
|
||||||
'removed in a future release. Use Smarty::registerPlugin to explicitly register ' .
|
'removed in a future release. Use Smarty::registerPlugin to explicitly register ' .
|
||||||
'a custom modifier.', E_USER_DEPRECATED);
|
'a custom modifier.', E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
$output = "{$modifier}({$params})";
|
$output = "{$modifier}({$params})";
|
||||||
}
|
}
|
||||||
$compiler->known_modifier_type[ $modifier ] = $type;
|
$compiler->known_modifier_type[ $modifier ] = $type;
|
||||||
|
|||||||
@@ -640,7 +640,17 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
return $func_name . '(' . $parameter[ 0 ] . ')';
|
return $func_name . '(' . $parameter[ 0 ] . ')';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return $name . '(' . implode(',', $parameter) . ')';
|
$first_param = array_shift($parameter);
|
||||||
|
$modifier = array_merge(array($name), $parameter);
|
||||||
|
// Now, compile the function call as a modifier
|
||||||
|
return $this->compileTag(
|
||||||
|
'private_modifier',
|
||||||
|
array(),
|
||||||
|
array(
|
||||||
|
'modifierlist' => array($modifier),
|
||||||
|
'value' => $first_param
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->trigger_template_error("unknown function '{$name}'");
|
$this->trigger_template_error("unknown function '{$name}'");
|
||||||
|
|||||||
@@ -2425,6 +2425,9 @@ public static $yy_action = array(
|
|||||||
if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
|
if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
|
||||||
$this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1];
|
$this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1];
|
||||||
} else {
|
} else {
|
||||||
|
trigger_error('Using unregistered static method "' . $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor[0] . '" in a template is deprecated and will be ' .
|
||||||
|
'removed in a future release. Use Smarty::registerClass to explicitly register ' .
|
||||||
|
'a class for access.', E_USER_DEPRECATED);
|
||||||
$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1];
|
$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ class Smarty_Security
|
|||||||
*
|
*
|
||||||
* @param string $function_name
|
* @param string $function_name
|
||||||
* @param object $compiler compiler object
|
* @param object $compiler compiler object
|
||||||
*
|
* @deprecated
|
||||||
* @return boolean true if function is trusted
|
* @return boolean true if function is trusted
|
||||||
*/
|
*/
|
||||||
public function isTrustedPhpFunction($function_name, $compiler)
|
public function isTrustedPhpFunction($function_name, $compiler)
|
||||||
|
|||||||
Reference in New Issue
Block a user