Re: Recursion to sanitize user input

From: Date: Sat, 09 Oct 2004 00:03:47 +0000
Subject: Re: Recursion to sanitize user input
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-199035@lists.php.net to get a copy of this message
* Thus wrote Yoed Anis: > Simple your code should look like this: > > ... > if ( is_array($userInput) ) > { > foreach ( $userInput as $key => $value ) > { > return sanitize( $value ); //<-------- needed to return it or > else its not recurssive This is wrong, only the first item of each array will ever be seen. Curt -- The above comments may offend you. flame at will.

« previous php.general (#199035) next »