Re: Array to String

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
> On Mon, June 26, 2006 2:06 am, Jochem Maas wrote:
>>>   if (!get_magic_quotes_gpc()) {
>>>     if (isset($_POST)) {
>>>         foreach ($_POST as $key => $value) {
>>>             $_POST[$key] = trim(addslashes($value));
>>>         }
>>>     }
>>>
>>>     if (isset($_GET)) {
>>>         foreach ($_GET as $key => $value) {
>>>             $_GET[$key] = trim(addslashes($value));
>>>         }
>>>     }
>>> }
> 
> If this is all your code is trying to do, then you might as well turn
> on Magic Quotes GPC in the first place, which means you've got bigger
> problems than this already...

seems that when I answered the OP I totally misread the code and assumed
we wanted to stripslashes when magic quotes wedre on (as opposed to
the other way around) - I guess my brain refused to accept someone would want
to do it the other way around and 'fixed' the code into something else.

oh well. the recursive function idea is still worthwhile even though the
actual example I gave is borked.

and for the rest: "what Richard said"

> 
> If it's just some legacy code you need to get running, fine and dandy.
> 
> If this is a new project you are starting on, find a more recent
> tutorial about Magic Quotes and SQL Injection attacks before you go
> any further.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux