Re: [SMARTY] get_magic_quotes_gpc problem : slashes - URGENT !

From: Date: Mon, 07 Jul 2003 11:30:55 +0000
Subject: Re: [SMARTY] get_magic_quotes_gpc problem : slashes - URGENT !
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9843@lists.php.net to get a copy of this message
if you mean too many backslashes when using $smarty.post.* : all stable releases of smarty use $HTTP_*_VARS and not $_*-vars. prepend a "$HTTP_POST_VARS =& $_POST;" before your stripslashes-loop. On Mon, Jul 07, 2003 at 02:02:33PM +0300, Irfan Uygur - Pusula Bilisim ve Internet Hiz. Ltd. Sti. wrote: > Hi everyone, > > I have finished my first project [not with php :) but with smarty] just now and while I was > making the final touched I just noticed > a problem : > problem with get_magic_quotes_gpc() settings. Thing that I type in form are escaped with > backslashes. > > When a user types this in a textbox : > > th'is is j"ust a te\st to see slashes problem > > On the next page this is shown : > > th\'is is j\"ust a te\\st to see slashes problem > > > You might say that this is an application logic problem not a presentation layer issue. But > normally I had done in all my previous > projects > the following which worked all the time : > > while( list($k, $v) = each($_POST[$k]) ) > { > $_POST[$k] = stripslashes($v); > } > > which all worked like a charm now. I know that this might break-up dbase insert's but this > is just for showing on web pages, I do > seperate > precautions like addslashes for dbase inserts. > > Althogh this must - and does- remove slashes from the post/get values, somehow still they are > escaped in smarty templates. I guess > somewhere > in the smarty class library, they are escaped again . And I am about to publish this project in > a live site tonight. Can somenone > advice me how to make > a quick fix ? Should I make a pre/post filter for this ? How do other people fix this problem > in their programs ? Any advice on this > issue will be greatly appriciated ... > > Thanks in advance, > > Regards, > Irfan Uygur > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

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