- bugfix {strip} must keep space on output creating smarty tags within html tags https://github.com/smarty-php/smarty/issues/177

This commit is contained in:
uwetews
2016-02-10 03:17:32 +01:00
parent 08db1a4a3f
commit 417088bdb7
2 changed files with 4 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.30-dev/32'; const SMARTY_VERSION = '3.1.30-dev/34';
/** /**
* define variable scopes * define variable scopes

View File

@@ -796,9 +796,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
$_store = 0; $_store = 0;
$space = ''; $space = '';
if ($this->parser->strip) { if ($this->parser->strip) {
$space = $this->has_output && preg_match('/^\040|\011/', $text) ? ' ' : '';
$this->has_output = false;
if (strpos($text, '<') !== false) { if (strpos($text, '<') !== false) {
// capture html elements not to be messed with // capture html elements not to be messed with
$_offset = 0; $_offset = 0;
@@ -838,6 +835,9 @@ abstract class Smarty_Internal_TemplateCompilerBase
} else { } else {
$text = preg_replace($this->stripRegEx, '', $text); $text = preg_replace($this->stripRegEx, '', $text);
} }
$space = $this->has_output && !preg_match('/^\s/', $text) ? ' ' : '';
$this->has_output = false;
} }
return new Smarty_Internal_ParseTree_Text($space . $text); return new Smarty_Internal_ParseTree_Text($space . $text);
} }