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

Modifier applied twice to nested elements

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Fri Dec 21, 2012 10:31 pm    Post subject: Modifier applied twice to nested elements Reply with quote

The following code:
{setfilter escape:"html"}{"{"&"}"}{/setfilter}
outputs:
&

Evidently, filter is applied first to inner string and then to outer string (i.e. {"{"&"|escape:"html"}"|escape:"html"}). In my opinion, this is not desired behavior. I would expect it to apply only to the outer bracket (i.e. {"{"&"}"|escape:"html"}).

The same problem with escape_html option. It escapes {"{"&"}"} code twice producing & . I can't imagine situation when somebody would want such double escapes.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Dec 23, 2012 7:49 pm    Post subject: Reply with quote

The filter does run on each tag which does create output. In this case the output of the inner tag is captured and used as input for the outer tag. So we got double escaping.

I will put this on the to do for 3.2
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 -> Feature Requests 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