From 6ba7d10ccd06400372967f61dd2e035e8d8c9f9a Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Mon, 14 Jun 2010 18:40:31 +0000 Subject: [PATCH] - make handling of Smarty comments followed by newline BC to Smarty2 --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_templatelexer.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index f98faf9f..f5a58102 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +14/06/2010 +- make handling of Smarty comments followed by newline BC to Smarty2 + 13/06/2010 - bugfix Smarty3 did not handle hexadecimals like 0x0F as numerical value - bugifx Smarty3 did not accept numerical constants like .1 or 2. (without a leading or trailing digit) diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 629909a8..ea14cd14 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -152,7 +152,7 @@ class Smarty_Internal_Templatelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s*(if|elseif|else if|while)(?![^\s]))|^(".$this->ldel."\\s*for(?![^\s]))|^(".$this->ldel."\\s*foreach(?![^\s]))|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>)))|^([\S\s]+)/"; + $yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel."\r?\n?)|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s*(if|elseif|else if|while)(?![^\s]))|^(".$this->ldel."\\s*for(?![^\s]))|^(".$this->ldel."\\s*foreach(?![^\s]))|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>)))|^([\S\s]+)/"; do { if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {