Re: [SMARTY-DEV] literal bug
| From: | Monte Ohrt | Date: | Fri, 23 May 2003 18:52:06 +0000 |
| Subject: | Re: [SMARTY-DEV] literal bug | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1508@lists.php.net to get a copy of this message | ||
What purpose is there putting spaces between the left delim and the
func/var name? It has never been supported, I don't see a need for it.
If anything, it might cause problems later letting this looser syntax
work.
Monte
On Fri, 2003-05-23 at 13:39, Paul Lockaby wrote:
> 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
> >
> >
--
Monte Ohrt <monte@ispi.net>