diff --git a/change_log.txt b/change_log.txt index 426d5e0a..09de16b6 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ - bugfix on backslash within single quoted strings - bugfix allow absolute filepath for config files - bugfix on special Smarty variable $smarty.cookies +- revert handling of newline on no output tags like {if...} 01/13/2010 - bugfix on {if} tags diff --git a/libs/sysplugins/smarty_internal_compile_capture.php b/libs/sysplugins/smarty_internal_compile_capture.php index 9a587859..752cb3ae 100644 --- a/libs/sysplugins/smarty_internal_compile_capture.php +++ b/libs/sysplugins/smarty_internal_compile_capture.php @@ -64,7 +64,7 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase { if (isset($append)) { $_output .= " \$_smarty_tpl->append($append, ob_get_contents());"; } - $_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean(); ?>"; + $_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean();?>"; return $_output; } } diff --git a/libs/sysplugins/smarty_internal_compile_if.php b/libs/sysplugins/smarty_internal_compile_if.php index d3fa9881..9d05f424 100644 --- a/libs/sysplugins/smarty_internal_compile_if.php +++ b/libs/sysplugins/smarty_internal_compile_if.php @@ -31,7 +31,7 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase { $_output .= "if (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value']."){?>"; return $_output; } else { - return "\n"; + return ""; } } } @@ -53,7 +53,7 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase { list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'elseif')); $this->_open_tag('else',array($nesting,$compiler->tag_nocache)); - return "\n"; + return ""; } } @@ -79,13 +79,13 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { if (empty($this->compiler->prefix_code)) { $this->_open_tag('elseif', array($nesting, $compiler->tag_nocache)); - return "\n"; + return ""; } else { $tmp = ''; foreach ($this->compiler->prefix_code as $code) $tmp .= $code; $this->compiler->prefix_code = array(); $this->_open_tag('elseif', array($nesting + 1, $compiler->tag_nocache)); - return "{$tmp}\n"; + return "{$tmp}"; } } } @@ -107,7 +107,7 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase { list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'else', 'elseif')); $tmp = ''; for ($i = 0; $i < $nesting ; $i++) $tmp .= '}'; - return "\n"; + return ""; } } diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index 52a4ff91..f82f038e 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -129,15 +129,15 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { $_output .= "\$_template->properties['nocache_hash'] = '{$compiler->template->properties['nocache_hash']}';\n"; $_output .= "\$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n"; $_output .= $compiled_tpl; - $_output .= "updateParentVariables($_parent_scope);?>"; - $_output .= "getTemplateFilepath() . "\" */ ?>"; + $_output .= "updateParentVariables($_parent_scope);?>\n"; + $_output .= "getTemplateFilepath() . "\" */ ?>\n"; $_output .= ""; } else { $_output .= " echo \$_template->getRenderedTemplate();?>"; $_output .= "updateParentVariables($_parent_scope);?>"; } } - $_output .= ""; + $_output .= "\n"; return $_output; } } diff --git a/libs/sysplugins/smarty_internal_compile_include_php.php b/libs/sysplugins/smarty_internal_compile_include_php.php index 96b3ebe9..e71f978d 100644 --- a/libs/sysplugins/smarty_internal_compile_include_php.php +++ b/libs/sysplugins/smarty_internal_compile_include_php.php @@ -57,13 +57,11 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { } } - $_output = 'assign(' . $_assign . ',ob_get_contents()); ob_end_clean();?>'; + return "assign({$_assign},ob_get_contents()); ob_end_clean();?>"; } else { - $_output .= 'include' . $_once . ' (\'' . $_file . '\');?>'; + return "\n"; } - return $_output; } } diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 61374ed3..68e3efd9 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -340,7 +340,7 @@ class Smarty_Internal_TemplateCompilerBase { $this->tag_nocache = false; $this->template->has_nocache_code = true; $_output = str_replace("'", "\'", $content); - $_output = "nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; + $_output = "nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>"; // make sure we include modifer plugins for nocache code if (isset($this->template->saved_modifer)) { foreach ($this->template->saved_modifer as $plugin_name => $dummy) {