diff --git a/change_log.txt b/change_log.txt index 6ef2b7da2..f0fcdcee1 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@  ===== 3.1.30-dev ===== (xx.xx.xx) + 20.02.2016 + - bugfix {strip} must keep space between hmtl tags. Broken by changes of 10.2.2016 https://github.com/smarty-php/smarty/issues/184 + 19.02.2016 - revert output buffer flushing on display, echo content again because possible problems when PHP files had characters (newline} after ?> at file end https://github.com/smarty-php/smarty/issues/187 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b1f7a03c6..6d81d44b6 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.30-dev/45'; + const SMARTY_VERSION = '3.1.30-dev/46'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index a091d90ba..38bfc799b 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -818,14 +818,13 @@ public function processText($text) $_store ++; } } - $expressions = array(// replace multiple spaces between tags by a single space // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements - '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1\2', + '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2', // remove spaces between attributes (but not in attribute values!) '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', - '#^\s+<#Ss' => $this->has_output ? ' <' : '<', '#>[\040\011]+$#Ss' => '> ', - '#>[\040\011]*[\n]\s*$#Ss' => '>', $this->stripRegEx => '',); + '#>[\040\011]+$#Ss' => '> ', '#>[\040\011]*[\n]\s*$#Ss' => '>', + $this->stripRegEx => '',); $text = preg_replace(array_keys($expressions), array_values($expressions), $text); $_offset = 0; @@ -844,7 +843,6 @@ public function processText($text) $text = preg_replace($this->stripRegEx, '', $text); } } - $this->has_output = false; return new Smarty_Internal_ParseTree_Text($text); } return null;