mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- bugfix PHP 7 compatibility on registered compiler plugins https://github.com/smarty-php/smarty/issues/241
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== 3.1.30-dev ===== (xx.xx.xx)
|
===== 3.1.30-dev ===== (xx.xx.xx)
|
||||||
|
13.07.2016
|
||||||
|
- bugfix PHP 7 compatibility on registered compiler plugins https://github.com/smarty-php/smarty/issues/241
|
||||||
|
|
||||||
12.07.2016
|
12.07.2016
|
||||||
- bugfix {foreach} item variable must be created also on empty from array https://github.com/smarty-php/smarty/issues/238 and https://github.com/smarty-php/smarty/issues/239
|
- bugfix {foreach} item variable must be created also on empty from array https://github.com/smarty-php/smarty/issues/238 and https://github.com/smarty-php/smarty/issues/239
|
||||||
- bugfix enableSecurity() must init cache flags https://github.com/smarty-php/smarty/issues/247
|
- bugfix enableSecurity() must init cache flags https://github.com/smarty-php/smarty/issues/247
|
||||||
|
@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.30-dev/74';
|
const SMARTY_VERSION = '3.1.30-dev/75';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -588,15 +588,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) {
|
if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) {
|
||||||
$this->tag_nocache = true;
|
$this->tag_nocache = true;
|
||||||
}
|
}
|
||||||
$function = $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ];
|
return call_user_func_array($this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ], array($new_args, $this));
|
||||||
if (!is_array($function)) {
|
|
||||||
return $function($new_args, $this);
|
|
||||||
} elseif (is_object($function[ 0 ])) {
|
|
||||||
return $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->{$function[ 1 ]}($new_args,
|
|
||||||
$this);
|
|
||||||
} else {
|
|
||||||
return call_user_func_array($function, array($new_args, $this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// compile registered function or block function
|
// compile registered function or block function
|
||||||
if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
|
if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
|
||||||
@@ -669,15 +661,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
foreach ($args as $mixed) {
|
foreach ($args as $mixed) {
|
||||||
$new_args = array_merge($new_args, $mixed);
|
$new_args = array_merge($new_args, $mixed);
|
||||||
}
|
}
|
||||||
$function = $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ];
|
return call_user_func_array($this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ], array($new_args, $this));
|
||||||
if (!is_array($function)) {
|
|
||||||
return $function($new_args, $this);
|
|
||||||
} elseif (is_object($function[ 0 ])) {
|
|
||||||
return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($new_args,
|
|
||||||
$this);
|
|
||||||
} else {
|
|
||||||
return call_user_func_array($function, array($new_args, $this));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter,
|
return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter,
|
||||||
$tag);
|
$tag);
|
||||||
@@ -728,15 +712,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) {
|
if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) {
|
||||||
$this->tag_nocache = true;
|
$this->tag_nocache = true;
|
||||||
}
|
}
|
||||||
$function = $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ];
|
return call_user_func_array($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ], array($args, $this));
|
||||||
if (!is_array($function)) {
|
|
||||||
return $function($args, $this);
|
|
||||||
} elseif (is_object($function[ 0 ])) {
|
|
||||||
return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args,
|
|
||||||
$this);
|
|
||||||
} else {
|
|
||||||
return call_user_func_array($function, array($args, $this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
|
if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
|
||||||
$plugin = 'smarty_compiler_' . $tag;
|
$plugin = 'smarty_compiler_' . $tag;
|
||||||
@@ -990,11 +966,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
$this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
|
$this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_string($callback) &&
|
|
||||||
!(is_array($callback) && is_string($callback[ 0 ]) && is_string($callback[ 1 ]))
|
|
||||||
) {
|
|
||||||
$this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");
|
|
||||||
}
|
|
||||||
if (is_callable($callback)) {
|
if (is_callable($callback)) {
|
||||||
$this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback, true, array());
|
$this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback, true, array());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user