RE : [SMARTY] Striping backslashes in _POST, _GET
| From: | Christopher Rousseau | Date: | Wed, 15 Oct 2003 13:45:52 +0000 |
| Subject: | RE : [SMARTY] Striping backslashes in _POST, _GET | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10353@lists.php.net to get a copy of this message | ||
I just check the code generated by smarty :
Smarty use another array for that and replace {smarty.get.variable} by
$GLOBALS['HTTP_GET_VARS'][ variable']
I don't like the php way of escaping GET and POST variable, so I disable it in php.ini and
don't have to do that:
magic_quotes_gpc = Off
Generally, then I thing smarty could have a strange behavior I look at the code generated by Smarty.
Don't forget that Smarty, for performance raison, translate your template in php code. Juste
take a look at it to understand why it doesn't work the way you expected it! (in the compiled
template directory. And after, if you thing it's a bug or whatever, ask around :)
Have a nice day coding :)
-----Message d'origine-----
De : Jiøí Nìmec [mailto:konference@menea.cz]
Envoyé : mercredi 15 octobre 2003 14:38
À : smarty-general@lists.php.net
Objet : [SMARTY] Striping backslashes in _POST, _GET
Hello,
I wrote a function which strips backslashes pro given array. It works
well, if I use this function eg. on $_GET and then write out this
array - var_dump($_GET) all backslashes are stripped. But if I write
variables in template, there are backslashes again.
function stripsl(&$item){
$item = stripslashes($item);
}
array_walk($_GET, 'stripsl');
var_dump($_GET); //array is stripped - ok
template:
{smarty.get.variable} // there are backslashes again
I tried use this function before and after inicialization smarty class
and it doesn't work...have got somebody some idea? (I don't want to
turn off magic_quotes).
Jiří Němec, ICQ: 114651500
www.menea.cz - www stránky a aplikace
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php