diff options
| -rw-r--r-- | change_log.txt | 1 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_capture.php | 2 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_if.php | 10 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_include.php | 6 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_include_php.php | 6 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_templatecompilerbase.php | 2 |
6 files changed, 13 insertions, 14 deletions
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 "<?php if ({$args['if condition']}){?>\n"; + return "<?php if ({$args['if condition']}){?>"; } } } @@ -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 "<?php }else{ ?>\n"; + return "<?php }else{ ?>"; } } @@ -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 "<?php }elseif({$args['if condition']}){?>\n"; + return "<?php }elseif({$args['if condition']}){?>"; } 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 "<?php }else{?>{$tmp}<?php if ({$args['if condition']}){?>\n"; + return "<?php }else{?>{$tmp}<?php if ({$args['if condition']}){?>"; } } } @@ -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 "<?php {$tmp}?>\n"; + return "<?php {$tmp}?>"; } } 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 .= "<?php \$_smarty_tpl->updateParentVariables($_parent_scope);?>"; - $_output .= "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>"; + $_output .= "<?php \$_smarty_tpl->updateParentVariables($_parent_scope);?>\n"; + $_output .= "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>\n"; $_output .= "<?php \$_smarty_tpl = array_pop(\$_tpl_stack);?>"; } else { $_output .= " echo \$_template->getRenderedTemplate();?>"; $_output .= "<?php \$_template->updateParentVariables($_parent_scope);?>"; } } - $_output .= "<?php unset(\$_template);?>"; + $_output .= "<?php unset(\$_template);?>\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 = '<?php '; if (isset($_assign)) { - $_output .= 'ob_start(); include' . $_once . ' (\'' . $_file . '\'); $_smarty_tpl->assign(' . $_assign . ',ob_get_contents()); ob_end_clean();?>'; + return "<?php ob_start(); include{$_once} ('{$_file}'); \$_smarty_tpl->assign({$_assign},ob_get_contents()); ob_end_clean();?>"; } else { - $_output .= 'include' . $_once . ' (\'' . $_file . '\');?>'; + return "<?php include{$_once} ('{$_file}');?>\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 = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
+ $_output = "<?php echo '/*%%SmartyNocache:{$this->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) {
|
