diff --git a/change_log.txt b/change_log.txt index 2f9ebffa..97e4f860 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +11/06/2010 +- bugfix the lexer did fail on larger {literal} ... {/literal} sections + 03/06/2010 - bugfix on calling template functions like Smarty tags diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 1a946663..b8206ff5 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -842,13 +842,14 @@ class Smarty_Internal_Templatelexer 2 => 0, 3 => 0, 4 => 0, - 5 => 2, - 8 => 0, + 5 => 0, + 6 => 2, + 9 => 0, ); if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^(([\S\s]*?)(?=(".$this->ldel."\/?literal".$this->rdel."|<\\?)))|^([\S\s]+)/"; + $yy_global_pattern = "/^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^([\t ]*[\r\n]+[\t ]*)|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."\/?literal".$this->rdel."|<\\?)))|^([\S\s]+)/"; do { if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { @@ -913,24 +914,29 @@ class Smarty_Internal_Templatelexer function yy_r3_3($yy_subpatterns) { + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + function yy_r3_4($yy_subpatterns) + { + if (in_array($this->value, Array('token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG; } else { $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG; $this->value = substr($this->value, 0, 2); } - } - function yy_r3_4($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } function yy_r3_5($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } - function yy_r3_8($yy_subpatterns) + function yy_r3_6($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + function yy_r3_9($yy_subpatterns) { $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");