Re: [SMARTY] Re: object calls fail after upgrade to 2.6.4
Monte Ohrt <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel,gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
After a closer look, it seems that nested objects worked unintentionally
because Smarty saw the dash "-" in the "->" as a math operator and
allowed it to slip through the parser. I tightened up the parsing a bit
("->" is no longer mistaken as a math operator) and now your code
correctly fails ;)
The reason objects as parameters to objects was not allowed is because
PCRE does not support infinite recursion, and this would certainly not
be practical to parse:
{$foo->bar($foo->bar($foo->bar(...)))}
However, since there is code relying on these little discrepancies, I
have just committed to CVS the ability to do one level of object
nesting. So, this is valid syntax:
{$foo->bar($foo->bar))}
{$foo->bar($foo->bar()))}
{$foo->bar($foo->bar($foo)))}
{$foo->bar($foo->bar($foo,$bar.blah,0))}
However this is NOT permitted:
{$foo->bar($foo->bar($foo->bar)))}
Please test and let me know if there are problems.
Monte
hans wrote:
>On Thu, 9 Sep 2004, Monte Ohrt wrote:
>
>
>
>>objects as params to objects has never been supported:
>>
>>{$obj->meth($foo->var))}
>>
>>
>
>Hmm, but it worked in 2.6.3, I have a lot of code relying on it. Even this
>used to work, and doesn't anymore:
>
> {$obj->meth($foo->var.bar)}
>=> $this->_tpl_vars['foo']->var['bar']
>
>Also, messju is right, the case where the first argument is a numeric
>constant is still broken.
>
>Hans
>
>
>!DSPAM:414069f8143622566370718!
>
>
>
>
>
>
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php