Re: [SMARTY] RE : [SMARTY] Striping backslashes in _POST, _GET
| From: | Rob Schultz | Date: | Thu, 16 Oct 2003 01:54:14 +0000 |
| Subject: | Re: [SMARTY] RE : [SMARTY] Striping backslashes in _POST, _GET | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10357@lists.php.net to get a copy of this message | ||
If you look at
http://smarty.php.net/manual/en/variable.request.use.auto.globals.php
You can make smarty use the $_* variables instead of $HTTP_*_VARS[]
which then the script would work.. But if i remember right i think this
was only added in 2.6.0 or maybe 2.5.0 can't remember..
Quoting Christopher Rousseau <christopher.rousseau@rezotech.com>:
> 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
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>