2 Commits

Author SHA1 Message Date
9c46c94d84 Smarty v4 update to v4.5.1 2024-03-19 10:34:56 +09:00
e0b4e35e99 Publish: v4.4.1 2024-03-06 18:44:00 +09:00
6 changed files with 22 additions and 7 deletions

View File

@@ -1 +1 @@
4.3.4 4.4.1

View File

@@ -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
*/ */

View File

@@ -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'])) {
'removed in a future release. Use Smarty::registerPlugin to explicitly register ' . trigger_error('Using unregistered function "' . $modifier . '" in a template is deprecated and will be ' .
'a custom modifier.', E_USER_DEPRECATED); 'removed in a future release. Use Smarty::registerPlugin to explicitly register ' .
'a custom modifier.', E_USER_DEPRECATED);
}
$output = "{$modifier}({$params})"; $output = "{$modifier}({$params})";
} }
$compiler->known_modifier_type[ $modifier ] = $type; $compiler->known_modifier_type[ $modifier ] = $type;

View File

@@ -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}'");

View File

@@ -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 {

View File

@@ -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)