|
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 |
weirdWeazel Smarty n00b
Joined: 27 Feb 2014 Posts: 2
|
Posted: Thu Feb 27, 2014 2:41 pm Post subject: [smarty3] Problems with variable escaping. |
|
|
Hi!
I initially intended to just implement a simple escaping when displaying a form with submitted form values, which should be escaped. That's it.
When searching for ways to do it with smarty, I mostly found the answer 'upgrade to Smarty 3' which I then did. (2.6.26 to 3.1.16).
After a pretty long search I found out that I may enable escaping either with
Code: | $smarty->default_modifiers = array('escape:"htmlall"'); |
or
Code: | $smarty->escape_html = TRUE; |
They both have the same effect and both after I reset the templates.
Problem is, they escape EVERY variable in a way, that the HTML templates won't get rendered but displayed as markup.
Example:
Code: | <div class="box left "> <h1>Hi tester!</h1> <div class="wrap large">... |
This should be displayed as correctly style box and not as HTML code.
The documentation about these features is really sparse and I couldn't find the problem I'm having either here in this forum or at stackoverflow, so I created my own thread. Sorry, if this has been answered, I didn't find any answer.
Also: Is there a way to JUST escape forms without building my own filter?
That would be great! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
weirdWeazel Smarty n00b
Joined: 27 Feb 2014 Posts: 2
|
Posted: Thu Feb 27, 2014 3:43 pm Post subject: |
|
|
Hi, thank you, I know.
But the problem is, that the whole template is not being rendered but escaped. If I added the 'nofilter' the variables on the layer below wouldn't be escaped either - or would they? |
|
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
|