Magic Quotes Removal code - almost there
| From: | lists) | Date: | Thu, 10 Feb 2005 15:36:50 +0000 |
| Subject: | Magic Quotes Removal code - almost there | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-208450@lists.php.net to get a copy of this message | ||
The following code is passed $_POST to clean magic quotes code out ;_
function remove_magic_quotes( &$array ) {
foreach( $array as $index => $value ) {
if ( is_array( $array[$index] ) ) {
remove_magic_quotes( $array[$index] );
} else {
if ( magic_quotes_runtime() ){
echo "removing slashes $value<br />";
$array[$index] = stripslashes( $value );
}
}
}
}
The cleaning works but magic_quotes_runtime is false even if magic codes
are on, any ideas?
Ben
--
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc