|
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 |
zipi Smarty n00b
Joined: 03 Aug 2017 Posts: 3
|
Posted: Thu Aug 03, 2017 10:07 am Post subject: Smarty variable containing "&" is transformed |
|
|
Hello,
Here is my problem :
1. I send to smarty this variable :$url=>http://www.test.com/index.php?var1=toto&var2=tata
2. My tpl code is as it :
Code: |
<script type="text/javascript">
{$url}
</script>
|
3. My proble is that the "&" character is transformed by smarty inside the <script> balise. Indeed the & character becomes "&" !
What am I doing wrong ?
Thnaks a lot ! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Aug 03, 2017 11:22 am Post subject: |
|
|
First, Smarty knows nothing about <script> in first place.
Second, most likely, you're using blind default escaping. |
|
Back to top |
|
zipi Smarty n00b
Joined: 03 Aug 2017 Posts: 3
|
Posted: Thu Aug 03, 2017 2:24 pm Post subject: |
|
|
Hello AnrDaemon ! Thks for your answer ! Please could you explicit "you're using blind default escaping" ?
Thanks a lot.
Vins |
|
Back to top |
|
zipi Smarty n00b
Joined: 03 Aug 2017 Posts: 3
|
Posted: Thu Aug 03, 2017 2:53 pm Post subject: |
|
|
I found the solution !
just put Code: | <script type="text/javascript">
{$url nofilter}
</script> |
Thks ! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
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
|