Re: [SMARTY-DEV] literal bug

From: Date: Fri, 23 May 2003 18:39:54 +0000
Subject: Re: [SMARTY-DEV] literal bug
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1507@lists.php.net to get a copy of this message
The fix for this, as applied to the most recent CVS goes something like this: Line 251 in Smarty_Compiler should be changed to this: preg_match_all("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", $template_source, $_match); Line 253 and 254 in Smarty_Compiler should be changed to this: $template_source = preg_replace("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", $this->quote_replace($this->left_delimiter.'literal'.$this->right_delimiter), $template_source); Enjoy! Paul Lockaby wrote:
Hi, I was going through the Smarty code and I found this little bug. If you have spaces between the left and right delimiters, the parsing engine will return an error and stop execution. Here is an example. This fails: { literal }blah blibbidy blah{ /literal } And returns this error: Fatal error: Smarty error: [in smarty.tpl line 12]: [plugin] unknown tag - '/literal' (Smarty.class.php, line 2522) in Smarty.class.php on line 2633 Note that I am not using the most recent CVS version of Smarty. I'm using the most recent version before all the abstractioning took place. -Paul Lockaby


« previous php.smarty.dev (#1507) next »