Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Bug in 3.1.21

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
calguy1000
Smarty Rookie


Joined: 27 Mar 2009
Posts: 25

PostPosted: Sun Nov 23, 2014 1:02 am    Post subject: Bug in 3.1.21 Reply with quote

This simple template fails in 3.1.21 but passes in 3.1.20

Code:
{* this code fails in smarty 3.1.21 *}
<html>
<head>
<title>Info</title>
</head>
<body>

{function test}
the quick brown fox jumps over the lazy dog
{/function}

{capture assign='foo1c'}{test|ucwords}{/capture}  {* plugin output to a modifier in a capture block *}
<p>foo1c = {$foo1c}</p>

</body>
</html>


The error returned is:

Code:
Parse error: syntax error, unexpected 'list' (T_LIST), expecting ',' or ';' in /var/www/smarty_test/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 52

Fatal error: Uncaught --> Smarty: Invalid compiled template for 'index.tpl' <-- thrown in /var/www/smarty_test/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 182


Essentially {plugin|modifier} will not work inside a {capture} block. However {$variable|modifier} will.
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Nov 23, 2014 12:34 pm    Post subject: Reply with quote

The fix is now in the github trunk at https://github.com/smarty-php/smarty and will later be included in 3.1.22.

The problem occurs when the plugin tag was immediately followed by another tag.

Code:
{capture assign='foo1c'}{test|ucwords} {/capture}

would work
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP