|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Fri Dec 21, 2012 10:31 pm Post subject: Modifier applied twice to nested elements |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Dec 23, 2012 7:49 pm Post subject: |
|
|
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 |
|
|
|
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
|