From 96c2a9c71a0dc0b3f07bc8cd444733acf510d198 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Tue, 27 Aug 2013 19:42:38 +0000 Subject: [PATCH] - bugfix delimiter followed by linebreak did not work as auto literak after update form 24.08.2013 (forum topic 24518} --- change_log.txt | 3 ++ .../smarty_internal_templatelexer.php | 54 +++++++++---------- .../smarty_internal_templateparser.php | 2 +- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/change_log.txt b/change_log.txt index 11386f01..49f46a07 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +27.08.2013 +- bugfix delimiter followed by linebreak did not work as auto literak after update form 24.08.2013 (forum topic 24518} + 24.08.2013 - bugfix and enhancement Because several recent problems with template inheritance the {block} tag compiler has been rewriten diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 8bfe507f..61555aba 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -205,7 +205,7 @@ class Smarty_Internal_Templatelexer function yy_r1_4($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_STRIPON; @@ -214,7 +214,7 @@ class Smarty_Internal_Templatelexer function yy_r1_5($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; @@ -223,7 +223,7 @@ class Smarty_Internal_Templatelexer function yy_r1_6($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; @@ -233,7 +233,7 @@ class Smarty_Internal_Templatelexer function yy_r1_7($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; @@ -244,7 +244,7 @@ class Smarty_Internal_Templatelexer function yy_r1_9($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; @@ -255,7 +255,7 @@ class Smarty_Internal_Templatelexer function yy_r1_10($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; @@ -266,7 +266,7 @@ class Smarty_Internal_Templatelexer function yy_r1_11($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; @@ -277,7 +277,7 @@ class Smarty_Internal_Templatelexer function yy_r1_12($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; @@ -288,7 +288,7 @@ class Smarty_Internal_Templatelexer function yy_r1_13($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; @@ -786,7 +786,7 @@ class Smarty_Internal_Templatelexer function yy_r2_70($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; @@ -797,7 +797,7 @@ class Smarty_Internal_Templatelexer function yy_r2_72($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; @@ -808,7 +808,7 @@ class Smarty_Internal_Templatelexer function yy_r2_73($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; @@ -819,7 +819,7 @@ class Smarty_Internal_Templatelexer function yy_r2_74($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; @@ -830,7 +830,7 @@ class Smarty_Internal_Templatelexer function yy_r2_75($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; @@ -913,7 +913,7 @@ class Smarty_Internal_Templatelexer function yy_r3_1($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; @@ -923,7 +923,7 @@ class Smarty_Internal_Templatelexer function yy_r3_2($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; @@ -1049,7 +1049,7 @@ class Smarty_Internal_Templatelexer function yy_r4_1($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; @@ -1060,7 +1060,7 @@ class Smarty_Internal_Templatelexer function yy_r4_3($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; @@ -1071,7 +1071,7 @@ class Smarty_Internal_Templatelexer function yy_r4_4($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; @@ -1082,7 +1082,7 @@ class Smarty_Internal_Templatelexer function yy_r4_5($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; @@ -1093,7 +1093,7 @@ class Smarty_Internal_Templatelexer function yy_r4_6($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; @@ -1211,7 +1211,7 @@ class Smarty_Internal_Templatelexer function yy_r5_1($yy_subpatterns) { - if ($this->smarty->auto_literal&& substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { return false; } else { $this->token = Smarty_Internal_Templateparser::TP_STRIPON; @@ -1220,7 +1220,7 @@ class Smarty_Internal_Templatelexer function yy_r5_2($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { return false; } else { $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; @@ -1229,7 +1229,7 @@ class Smarty_Internal_Templatelexer function yy_r5_3($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { return false; } else { $this->yypopstate(); @@ -1321,7 +1321,7 @@ class Smarty_Internal_Templatelexer function yy_r6_1($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; } else { $this->yypopstate(); @@ -1331,7 +1331,7 @@ class Smarty_Internal_Templatelexer function yy_r6_2($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; } else { $this->yypopstate(); @@ -1341,7 +1341,7 @@ class Smarty_Internal_Templatelexer function yy_r6_3($yy_subpatterns) { - if ($this->smarty->auto_literal && substr($this->value,$this->ldel_length,1) == ' ') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; } else { $this->yypopstate(); diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index 06ec28e4..482af6e2 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -3241,4 +3241,4 @@ static public $yy_action = array( } } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } -} +} \ No newline at end of file