Re: Re: SQL Injection - Solution

From: Date: Wed, 06 May 2009 18:13:25 +0000
Subject: Re: Re: SQL Injection - Solution
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-292356@lists.php.net to get a copy of this message
Igor Escobar wrote: > hun...by the way.... I forgot to mention, I am Brazilian and here in Brazil > these words are not common ... Yes, but you can reuse your function even if you start accepting english posts/comments, etc. You don't want this function to be specific to your app or data because it isn't extensible or portable. Also, I suspect that there are some words in portuguese that "contain" "or", which would be removed. > > That is a recursive function and i can use array_map becouse i some cases we > obtain arrays of arrays and that will generate a error. > Yes, it is recursive, so that it works on arrays of arrays :-) No error that I have seen. $_GET = array( 'test' => 'some stuff "here"', 'test_array' => array('a"a','bb',array('x"x','yy','z')) ); print_r(_antiSqlInjection($_GET)); Array ( [test] => some stuff \"here\" [test_array] => Array ( [0] => a\"a [1] => b\'b [2] => Array ( [0] => x\"x [1] => y\'y [2] => z ) ) ) -- Thanks! -Shawn http://www.spidean.com

« previous php.general (#292356) next »