|
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 |
g00fy Smarty Rookie
Joined: 07 Dec 2005 Posts: 19
|
Posted: Mon Jun 07, 2010 9:29 am Post subject: escape doesn't work very well for Smarty3Dev |
|
|
I took an example from the Smarty2 help pages:
Code: | {assign var="articleTitle" value="'Wij geloven dat Vlaanderen sterker zal worden & dat België zal uitdoven.'"}
{* {assign var="articleTitle" value="'Stiff Opposition Expected to Casketless Funeral Plan'"} *}
{assign var="EmailAddress" value="smarty@example.com"}
{$articleTitle}
'Stiff Opposition Expected to Casketless Funeral Plan'
{$articleTitle|escape}
'Stiff Opposition Expected to Casketless Funeral Plan'
{$articleTitle|escape:"html"} {* escapes & " ' < > *}
'Stiff Opposition Expected to Casketless Funeral Plan'
{$articleTitle|escape:'htmlall'} {* escapes ALL html entities *}
'Stiff Opposition Expected to Casketless Funeral Plan'
<a href="?title={$articleTitle|escape:'url'}">click here</a>
<a href="?title=%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27">click here</a>
{$articleTitle|escape:'quotes'}
\'Stiff Opposition Expected to Casketless Funeral Plan\'
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
<a href="mailto:%62%6f%..snip..%65%74">bob..snip..et</a>
{$EmailAddress|escape:'mail'}
smarty [AT] example [DOT] com
{* email address mangled *}
<a href="mailto:{$EmailAddress|escape:'hex'}">{$EmailAddress|escape:'mail'}</a>
|
The escape, escape-html and escape-htmlall doesn't seem to work anymore?
This results in:
Code: |
'Wij geloven dat Vlaanderen sterker zal worden & dat België zal uitdoven.'
'Stiff Opposition Expected to Casketless Funeral Plan'
'Stiff Opposition Expected to Casketless Funeral Plan'
'Stiff Opposition Expected to Casketless Funeral Plan'
'Stiff Opposition Expected to Casketless Funeral Plan'
<a href="?title=%27Wij%20geloven%20dat%20Vlaanderen%20sterker%20zal%20worden%20%26%20dat%20Belgi%EB%20zal%20uitdoven.%27">click here</a>
<a href="?title=%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27">click here</a>
\'Wij geloven dat Vlaanderen sterker zal worden & dat België zal uitdoven.\'
\'Stiff Opposition Expected to Casketless Funeral Plan\'
<a href="mailto:%73%6d%61%72%74%79%40%65%78%61%6d%70%6c%65%2e%63%6f%6d">smarty@example.com</a>
<a href="mailto:%62%6f%..snip..%65%74">bob..snip..et</a>
smarty [AT] example [DOT] com
smarty [AT] example [DOT] com
<a href="mailto:%73%6d%61%72%74%79%40%65%78%61%6d%70%6c%65%2e%63%6f%6d">smarty [AT] example [DOT] com</a> |
But with the default sample it does work fine! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jun 07, 2010 1:34 pm Post subject: |
|
|
what isn't working? what were you expecting? |
|
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
|