Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty fails to strip whitespace inside function calls

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
hexetic
Smarty n00b


Joined: 08 Dec 2015
Posts: 3

PostPosted: Tue Dec 08, 2015 8:29 pm    Post subject: Smarty fails to strip whitespace inside function calls Reply with quote

Sometimes it is nice to split up a long {call} block over several lines. It is also nice to indent those following lines to make it clear that they're part of the same level of indentation, e.g.:

Code:
{call name="someFun"
       param1="val1"
       param2="val2"
       ...
}


The problem is, Smarty will include those spaces in the generated code, breaking the parameters:

Code:
<?php smarty_template_function_someFun($_smarty_tpl,array('       param1'='val1','       param2'='val2', ...));?>


Due to the leading spaces before 'param1', 'param2', etc., the function parameters do not inject properly.

Surely, whitespace should be ignored inside {call}s?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1268

PostPosted: Wed Dec 09, 2015 12:10 pm    Post subject: Reply with quote

And just what version of the Smarty you are using?
Back to top
View user's profile Send private message
hexetic
Smarty n00b


Joined: 08 Dec 2015
Posts: 3

PostPosted: Wed Dec 09, 2015 6:51 pm    Post subject: Reply with quote

Debian package smarty3 version 3.1.10-2
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Dec 10, 2015 4:59 am    Post subject: Reply with quote

Update Smarty your version is outdate very long.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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