Re: [SMARTY] $HTTP_*_VARS linked to Smarty, makes problems with stripping slashes

From: Date: Thu, 13 Feb 2003 20:05:41 +0000
Subject: Re: [SMARTY] $HTTP_*_VARS linked to Smarty, makes problems with stripping slashes
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7743@lists.php.net to get a copy of this message
Yes, I think Smarty should 'smartly' begin transition to this type of GET/POST/COOKIE usage. But I also think it should be part of a PLAN for the next release. 2/13/2003 11:07:06 AM, "Joscha Feth" <joscha@feth.com> wrote: >Hi, > >This is mainly a message to the authors of Smarty, I couldn't find a place >to report bugs and suggestions. > >Think of this: >In many machines, magic_quotes_gpc is enabled, if you now pass some data to >a page, it automatically adds slashes (or does not if magic_quotes is >disabled). I wrote a function to have consistency of vars passed to a page, >e.g. the function always makes sure, that the data has "magic" quotes or >not, regardless of magic_quotes_gpc enabled or disabled. You can find this >function here: >http://dev.feth.com/PHP/my_magic_quotes.phps > >Comment: Please don't tell me not to change $_* because it is bad coding >style, you have the choice: either you work on $_* or you can fill up the >memory with copies of it :-D > >The problem now is, that I apply this function $_POST, but Smarty still >works with the old $HTTP_POST_VARS, so the code: > >$_POST = my_magic_quotes($_POST); > >changes $_POST but not the $smarty.post value > >$_POST["somevar"] and in a template {$smarty.post.somevar} do not have the >same value. > >I now use a workaround and do: > >$_POST = my_magic_quotes($_POST); >$HTTP_POST_VARS = $_POST; //~ to bad I can not pass a reference e.g. >$HTTP_POST_VARS = &$_POST; > > >But I think as we are on PHP version 4.3 and not > 4.1 Smarty should use $_* >where available and $HTTP_*_VARS in older versions. >Also it would be fine if the {$smarty.*} would use references instead of >copying it into the own namespace. > >If you have questions or did not understand what I mean,please reply! >Greets, >Joscha > > > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.smarty.general (#7743) next »