Re: Re: SQL Injection - Solution

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

 



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','b`b',array('x"x','y`y','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

-- 
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