summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/plugins/block.php.php4
-rw-r--r--libs/plugins/block.textformat.php2
-rw-r--r--libs/plugins/function.counter.php2
-rw-r--r--libs/plugins/function.cycle.php2
-rw-r--r--libs/plugins/function.fetch.php6
-rw-r--r--libs/plugins/function.html_checkboxes.php2
-rw-r--r--libs/plugins/function.html_image.php8
-rw-r--r--libs/plugins/function.html_options.php2
-rw-r--r--libs/plugins/function.html_radios.php2
-rw-r--r--libs/plugins/function.html_select_date.php2
-rw-r--r--libs/plugins/function.html_select_time.php2
-rw-r--r--libs/plugins/function.html_table.php2
-rw-r--r--libs/plugins/function.mailto.php2
-rw-r--r--libs/plugins/function.math.php2
-rw-r--r--libs/plugins/function.popup.php2
-rw-r--r--libs/plugins/function.popup_init.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_config_load.php14
-rw-r--r--libs/sysplugins/smarty_internal_compile_continue.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_insert.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_block_plugin.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_function_plugin.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_object_block_function.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_object_function.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_registered_block.php12
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_registered_function.php6
-rw-r--r--libs/sysplugins/smarty_internal_config.php45
-rw-r--r--libs/sysplugins/smarty_internal_data.php4
-rw-r--r--libs/sysplugins/smarty_internal_nocache_insert.php4
28 files changed, 77 insertions, 68 deletions
diff --git a/libs/plugins/block.php.php b/libs/plugins/block.php.php
index 84a0275e..51a5a316 100644
--- a/libs/plugins/block.php.php
+++ b/libs/plugins/block.php.php
@@ -16,9 +16,9 @@
* @param object $template template object
* @return string content re-formatted
*/
-function smarty_block_php($params, $content, $smarty, &$repeat, $template)
+function smarty_block_php($params, $content, $template, &$repeat)
{
- if (!$smarty->allow_php_tag) {
+ if (!$template->allow_php_tag) {
throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable");
}
eval($content);
diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php
index 5d69c151..a91c0417 100644
--- a/libs/plugins/block.textformat.php
+++ b/libs/plugins/block.textformat.php
@@ -32,7 +32,7 @@
* @param object $template template object
* @return string content re-formatted
*/
-function smarty_block_textformat($params, $content, $smarty, &$repeat, $template)
+function smarty_block_textformat($params, $content, $template, &$repeat)
{
if (is_null($content)) {
return;
diff --git a/libs/plugins/function.counter.php b/libs/plugins/function.counter.php
index 534e9981..7c50bd44 100644
--- a/libs/plugins/function.counter.php
+++ b/libs/plugins/function.counter.php
@@ -19,7 +19,7 @@
* @param object $template template object
* @return string|null
*/
-function smarty_function_counter($params, $smarty, $template)
+function smarty_function_counter($params, $template)
{
static $counters = array();
diff --git a/libs/plugins/function.cycle.php b/libs/plugins/function.cycle.php
index 5dd16678..1c0ee905 100644
--- a/libs/plugins/function.cycle.php
+++ b/libs/plugins/function.cycle.php
@@ -44,7 +44,7 @@
* @return string|null
*/
-function smarty_function_cycle($params, $smarty, $template)
+function smarty_function_cycle($params, $template)
{
static $cycle_vars;
diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php
index 0a511830..0046d9eb 100644
--- a/libs/plugins/function.fetch.php
+++ b/libs/plugins/function.fetch.php
@@ -21,7 +21,7 @@
* @return string|null if the assign parameter is passed, Smarty assigns the
* result to a template variable
*/
-function smarty_function_fetch($params, $smarty, $template)
+function smarty_function_fetch($params, $template)
{
if (empty($params['file'])) {
trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE);
@@ -29,8 +29,8 @@ function smarty_function_fetch($params, $smarty, $template)
}
$content = '';
- if ($template->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
- if(!$smarty->security_handler->isTrustedResourceDir($params['file'])) {
+ if (isset($template->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+ if(!$template->security_policy->isTrustedResourceDir($params['file'])) {
return;
}
diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php
index 328faf44..dd3cddfc 100644
--- a/libs/plugins/function.html_checkboxes.php
+++ b/libs/plugins/function.html_checkboxes.php
@@ -39,7 +39,7 @@
* @return string
* @uses smarty_function_escape_special_chars()
*/
-function smarty_function_html_checkboxes($params, $smarty, $template)
+function smarty_function_html_checkboxes($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
//$smarty->loadPlugin('Smarty_shared_escape_special_chars');
diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php
index e2714a67..3515bbcc 100644
--- a/libs/plugins/function.html_image.php
+++ b/libs/plugins/function.html_image.php
@@ -34,7 +34,7 @@
* @return string
* @uses smarty_function_escape_special_chars()
*/
-function smarty_function_html_image($params, $smarty, $template)
+function smarty_function_html_image($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
//$smarty->loadPlugin('Smarty_shared_escape_special_chars');
@@ -47,7 +47,7 @@ function smarty_function_html_image($params, $smarty, $template)
$prefix = '';
$suffix = '';
$path_prefix = '';
- $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+ $server_vars = ($template->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
$basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
foreach($params as $_key => $_val) {
switch ($_key) {
@@ -108,8 +108,8 @@ function smarty_function_html_image($params, $smarty, $template)
return;
}
}
- if ($template->security) {
- if (!$smarty->security_handler->isTrustedResourceDir($_image_path)) {
+ if (isset($template->security_policy)) {
+ if (!$template->security_policy->isTrustedResourceDir($_image_path)) {
return;
}
}
diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php
index a4725809..1054ed07 100644
--- a/libs/plugins/function.html_options.php
+++ b/libs/plugins/function.html_options.php
@@ -29,7 +29,7 @@
* @return string
* @uses smarty_function_escape_special_chars()
*/
-function smarty_function_html_options($params, $smarty, $template)
+function smarty_function_html_options($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
//$smarty->loadPlugin('Smarty_shared_escape_special_chars');
diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php
index 39c02330..cad7b8dd 100644
--- a/libs/plugins/function.html_radios.php
+++ b/libs/plugins/function.html_radios.php
@@ -40,7 +40,7 @@
* @return string
* @uses smarty_function_escape_special_chars()
*/
-function smarty_function_html_radios($params, $smarty, $template)
+function smarty_function_html_radios($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
//$smarty->loadPlugin('Smarty_shared_escape_special_chars');
diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php
index cd20d689..19b69421 100644
--- a/libs/plugins/function.html_select_date.php
+++ b/libs/plugins/function.html_select_date.php
@@ -38,7 +38,7 @@
* @param object $template template object
* @return string
*/
-function smarty_function_html_select_date($params, $smarty, $template)
+function smarty_function_html_select_date($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
diff --git a/libs/plugins/function.html_select_time.php b/libs/plugins/function.html_select_time.php
index e9d95c2f..f2ca70f8 100644
--- a/libs/plugins/function.html_select_time.php
+++ b/libs/plugins/function.html_select_time.php
@@ -23,7 +23,7 @@
* @return string
* @uses smarty_make_timestamp()
*/
-function smarty_function_html_select_time($params, $smarty, $template)
+function smarty_function_html_select_time($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
require_once(SMARTY_PLUGINS_DIR . 'function.html_options.php');
diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php
index f279ad6d..6752221a 100644
--- a/libs/plugins/function.html_table.php
+++ b/libs/plugins/function.html_table.php
@@ -48,7 +48,7 @@
* @param object $template template object
* @return string
*/
-function smarty_function_html_table($params, $smarty, $template)
+function smarty_function_html_table($params, $template)
{
$table_attr = 'border="1"';
$tr_attr = '';
diff --git a/libs/plugins/function.mailto.php b/libs/plugins/function.mailto.php
index f75dc71b..ad4d9e2b 100644
--- a/libs/plugins/function.mailto.php
+++ b/libs/plugins/function.mailto.php
@@ -49,7 +49,7 @@
* @param object $template template object
* @return string
*/
-function smarty_function_mailto($params, $smarty, $template)
+function smarty_function_mailto($params, $template)
{
$extra = '';
diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php
index 197f4df1..5d717635 100644
--- a/libs/plugins/function.math.php
+++ b/libs/plugins/function.math.php
@@ -21,7 +21,7 @@
* @param object $template template object
* @return string|null
*/
-function smarty_function_math($params, $smarty, $template)
+function smarty_function_math($params, $template)
{
// be sure equation parameter is present
if (empty($params['equation'])) {
diff --git a/libs/plugins/function.popup.php b/libs/plugins/function.popup.php
index c646181a..2d3650ff 100644
--- a/libs/plugins/function.popup.php
+++ b/libs/plugins/function.popup.php
@@ -20,7 +20,7 @@
* @param object $template template object
* @return string
*/
-function smarty_function_popup($params, $smarty, $template)
+function smarty_function_popup($params, $template)
{
$append = '';
foreach ($params as $_key=>$_value) {
diff --git a/libs/plugins/function.popup_init.php b/libs/plugins/function.popup_init.php
index ba1f9a65..bcbab56d 100644
--- a/libs/plugins/function.popup_init.php
+++ b/libs/plugins/function.popup_init.php
@@ -21,7 +21,7 @@
* @return string
*/
-function smarty_function_popup_init($params, $smarty, $template)
+function smarty_function_popup_init($params, $template)
{
$zindex = 1000;
diff --git a/libs/sysplugins/smarty_internal_compile_config_load.php b/libs/sysplugins/smarty_internal_compile_config_load.php
index eb426922..733e1ac5 100644
--- a/libs/sysplugins/smarty_internal_compile_config_load.php
+++ b/libs/sysplugins/smarty_internal_compile_config_load.php
@@ -44,23 +44,19 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase {
} else {
$section = 'null';
}
- $scope = '$_smarty_tpl';
+ $scope = 'local';
// scope setup
if (isset($_attr['scope'])) {
$_attr['scope'] = trim($_attr['scope'], "'\"");
- if ($_attr['scope'] == 'parent') {
- $scope = '$_smarty_tpl->parent';
- } elseif ($_attr['scope'] == 'local') {
- $scope = '$_smarty_tpl';
- } elseif ($_attr['scope'] == 'global') {
- $scope = '$_smarty_tpl->smarty';
+ if (in_array($_attr['scope'],array('local','parent','root','global'))) {
+ $scope = $_attr['scope'];
} else {
$this->compiler->trigger_template_error('illegal value for "scope" attribute', $this->compiler->lex->taglineno);
- }
+ }
}
// create config object
$_output = "<?php \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
- $_output .= "\$_config->loadConfigVars($section, $scope); ?>";
+ $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>";
return $_output;
}
}
diff --git a/libs/sysplugins/smarty_internal_compile_continue.php b/libs/sysplugins/smarty_internal_compile_continue.php
index 6fce81af..7d796673 100644
--- a/libs/sysplugins/smarty_internal_compile_continue.php
+++ b/libs/sysplugins/smarty_internal_compile_continue.php
@@ -26,7 +26,7 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
* @return string compiled code
*/
public function compile($args, $compiler, $parameter)
- { {
+ {
$this->compiler = $compiler;
$this->smarty = $compiler->smarty;
// check and get attributes
diff --git a/libs/sysplugins/smarty_internal_compile_insert.php b/libs/sysplugins/smarty_internal_compile_insert.php
index bac54015..898e5315 100644
--- a/libs/sysplugins/smarty_internal_compile_insert.php
+++ b/libs/sysplugins/smarty_internal_compile_insert.php
@@ -106,14 +106,14 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase {
if ($_smarty_tpl->caching) {
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
} else {
- $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl), true);?>";
+ $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
}
} else {
$this->compiler->has_output = true;
if ($_smarty_tpl->caching) {
$_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
} else {
- $_output .= "echo {$_function}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>";
+ $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
}
}
return $_output;
diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
index 1ea264f7..7cfdc51c 100644
--- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
+++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
@@ -52,7 +52,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
// maybe nocache because of nocache variables or nocache plugin
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
// compile code
- $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else {
// must endblock be nocache?
if ($this->compiler->nocache) {
@@ -63,7 +63,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
// This tag does create output
$this->compiler->has_output = true;
// compile code
- $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function}({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
}
return $output . "\n";
}
diff --git a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
index 796d5722..965d696e 100644
--- a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
+++ b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
@@ -50,7 +50,7 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
// compile code
- $output = "<?php echo {$function}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
return $output;
}
}
diff --git a/libs/sysplugins/smarty_internal_compile_private_object_block_function.php b/libs/sysplugins/smarty_internal_compile_private_object_block_function.php
index a3550754..f3ae966f 100644
--- a/libs/sysplugins/smarty_internal_compile_private_object_block_function.php
+++ b/libs/sysplugins/smarty_internal_compile_private_object_block_function.php
@@ -53,7 +53,7 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter
// maybe nocache because of nocache variables or nocache plugin
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
// compile code
- $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$methode}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$methode}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else {
$base_tag = substr($tag, 0, -5);
// must endblock be nocache?
diff --git a/libs/sysplugins/smarty_internal_compile_private_object_function.php b/libs/sysplugins/smarty_internal_compile_private_object_function.php
index 1ca3e10d..f0755f06 100644
--- a/libs/sysplugins/smarty_internal_compile_private_object_function.php
+++ b/libs/sysplugins/smarty_internal_compile_private_object_function.php
@@ -52,7 +52,7 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
}
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
- $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl)";
+ $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl)";
} else {
$_params = implode(",", $_attr);
$return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params})";
diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php
index 87dbee6b..8f55a97c 100644
--- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php
+++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php
@@ -53,11 +53,11 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C
$function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag][0];
// compile code
if (!is_array($function)) {
- $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else if (is_object($function[0])) {
- $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else {
- $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
}
} else {
// must endblock be nocache?
@@ -72,11 +72,11 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C
$function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0];
// compile code
if (!is_array($function)) {
- $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function}({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
} else if (is_object($function[0])) {
- $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
} else {
- $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
}
}
return $output."\n";
diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/libs/sysplugins/smarty_internal_compile_private_registered_function.php
index 7712e78d..ca4e68db 100644
--- a/libs/sysplugins/smarty_internal_compile_private_registered_function.php
+++ b/libs/sysplugins/smarty_internal_compile_private_registered_function.php
@@ -51,11 +51,11 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
$function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag][0];
// compile code
if (!is_array($function)) {
- $output = "<?php echo {$function}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
} else if (is_object($function[0])) {
- $output = "<?php echo \$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
+ $output = "<?php echo \$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n";
} else {
- $output = "<?php echo {$function[0]}::{$function[1]}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n";
+ $output = "<?php echo {$function[0]}::{$function[1]}({$_params},\$_smarty_tpl);?>\n";
}
return $output;
}
diff --git a/libs/sysplugins/smarty_internal_config.php b/libs/sysplugins/smarty_internal_config.php
index 2ee2d595..3a540e99 100644
--- a/libs/sysplugins/smarty_internal_config.php
+++ b/libs/sysplugins/smarty_internal_config.php
@@ -12,9 +12,9 @@
class Smarty_Internal_Config {
static $config_objects = array();
- public function __construct($config_resource, $smarty, $template = null)
+ public function __construct($config_resource, $smarty, $data = null)
{
- $this->template = $template;
+ $this->data = $data;
$this->smarty = $smarty;
$this->config_resource = $config_resource;
$this->config_resource_type = null;
@@ -238,39 +238,52 @@ class Smarty_Internal_Config {
* @param mixed $sections array of section names, single section or null
* @param object $scope global,parent or local
*/
- public function loadConfigVars ($sections = null, $scope)
+ public function loadConfigVars ($sections = null, $scope = 'local')
{
- if (isset($this->template)) {
- $this->template->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp(),'file');
- } else {
- $this->smarty->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp(),'file');
+ if ($this->data instanceof Smarty_Internal_Template) {
+ $this->data->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp(),'file');
}
if ($this->mustCompile()) {
$this->compileConfigSource();
- }
+ }
+ // pointer to scope
+ if ($scope == 'local') {
+ $scope_ptr = $this->data;
+ } elseif ($scope == 'parent') {
+ if (isset($this->data->parent)) {
+ $scope_ptr = $this->data->parent;
+ } else {
+ $scope_ptr = $this->data;
+ }
+ } elseif ($scope == 'root' || $scope == 'global') {
+ $scope_ptr = $this->data;
+ while (isset($scope_ptr->parent)) {
+ $scope_ptr = $scope_ptr->parent;
+ }
+ }
$_config_vars = array();
- include($this->getCompiledFilepath ());
+ include($this->getCompiledFilepath ());
// copy global config vars
foreach ($_config_vars['vars'] as $variable => $value) {
- if ($this->smarty->config_overwrite || !isset($scope->config_vars[$variable])) {
+ if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
$scope->config_vars[$variable] = $value;
+ $scope_ptr->config_vars[$variable] = $value;
} else {
- $scope->config_vars[$variable] = array_merge((array)$scope->config_vars[$variable], (array)$value);
+ $scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$value);
}
}
// scan sections
foreach ($_config_vars['sections'] as $this_section => $dummy) {
if ($sections == null || in_array($this_section, (array)$sections)) {
foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
- if ($this->smarty->config_overwrite || !isset($scope->config_vars[$variable])) {
- $scope->config_vars[$variable] = $value;
+ if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
+ $scope_ptr->config_vars[$variable] = $value;
} else {
- $scope->config_vars[$variable] = array_merge((array)$scope->config_vars[$variable], (array)$value);
+ $scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$value);
}
}
}
- }
+ }
}
}
-
?> \ No newline at end of file
diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php
index 265555eb..5b8d48ab 100644
--- a/libs/sysplugins/smarty_internal_data.php
+++ b/libs/sysplugins/smarty_internal_data.php
@@ -247,8 +247,8 @@ class Smarty_Internal_Data {
public function configLoad($config_file, $sections = null)
{
// load Config class
- $config = new Smarty_Internal_Config($config_file, $this->smarty);
- $config->loadConfigVars($sections, $this);
+ $config = new Smarty_Internal_Config($config_file, $this->smarty, $this);
+ $config->loadConfigVars($sections);
}
/**
diff --git a/libs/sysplugins/smarty_internal_nocache_insert.php b/libs/sysplugins/smarty_internal_nocache_insert.php
index ae11a7ce..76e97816 100644
--- a/libs/sysplugins/smarty_internal_nocache_insert.php
+++ b/libs/sysplugins/smarty_internal_nocache_insert.php
@@ -34,9 +34,9 @@ class Smarty_Internal_Nocache_Insert {
}
// call insert
if (isset($_assign)) {
- $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl->smarty,\$_smarty_tpl), true);?>";
+ $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>";
} else {
- $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl->smarty,\$_smarty_tpl);?>";
+ $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";
}
$_tpl = $_template;
while ($_tpl->parent instanceof Smarty_Internal_Template) {