From fde7a592f4c717a0065acc673b40d14f3c373210 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Tue, 2 Feb 2010 20:09:57 +0000 Subject: [PATCH] - retaining newlines at registered functions and function plugins --- change_log.txt | 3 +++ .../smarty_internal_compile_private_block_plugin.php | 2 +- .../smarty_internal_compile_private_function_plugin.php | 4 ++-- .../smarty_internal_compile_private_object_block_function.php | 2 +- .../smarty_internal_compile_private_object_function.php | 4 ++-- .../smarty_internal_compile_private_registered_block.php | 2 +- .../smarty_internal_compile_private_registered_function.php | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/change_log.txt b/change_log.txt index 5731f489..6094767a 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +02/02/2010 +- retaining newlines at registered functions and function plugins + 01/25/2010 - bugfix cache resource was not loaded when caching was globally off but enabled at a template object - added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 030f3a2f..0c980e1f 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -66,7 +66,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $output = 'smarty, $_block_repeat, $_smarty_tpl); }?>'; } } - return $output; + 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 129b5d75..83b29d24 100644 --- a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -42,9 +42,9 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co $_params = 'array(' . implode(",", $_paramsArray) . ')'; // compile code if (is_array($function)) { - $output = 'smarty,$_smarty_tpl));?>'; + $output = "smarty,\$_smarty_tpl));?>\n"; } else { - $output = 'smarty,$_smarty_tpl);?>'; + $output = "smarty,\$_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 03c2d340..b0bd1684 100644 --- a/libs/sysplugins/smarty_internal_compile_private_object_block_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_object_block_function.php @@ -52,7 +52,7 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter // compile code $output = 'smarty->registered_objects[\'' . substr($tag, 0, -5) . '\'][0]->' . $methode . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>'; } - return $output; + return $output."\n"; } } diff --git a/libs/sysplugins/smarty_internal_compile_private_object_function.php b/libs/sysplugins/smarty_internal_compile_private_object_function.php index 573f6040..8e8ff944 100644 --- a/libs/sysplugins/smarty_internal_compile_private_object_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_object_function.php @@ -42,10 +42,10 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co } } $_params = 'array(' . implode(",", $_paramsArray) . ')'; - $output = "smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>"; + $output = "smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n"; } else { $_params = implode(",", $_attr); - $output = "smarty->registered_objects['{$tag}'][0]->{$methode}({$_params});?>"; + $output = "smarty->registered_objects['{$tag}'][0]->{$methode}({$_params});?>\n"; } return $output; } diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php index 218ec0e6..179929ac 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -72,7 +72,7 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C $output = 'smarty, $_block_repeat, $_smarty_tpl)); }?>'; } } - return $output; + 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 e38ee4b8..381c7f1d 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_function.php @@ -43,7 +43,7 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna } $_params = 'array(' . implode(",", $_paramsArray) . ')'; // compile code - $output = 'smarty->registered_plugins[\'function\'][\'' . $tag . '\'][0],array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl));?>'; + $output = "smarty->registered_plugins['function']['{$tag}'][0],array({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl));?>\n"; return $output; } }