note 93493 deleted from function.get-magic-quotes-gpc by danbrown
| From: | danbrown@php.net | Date: | Sun, 13 Sep 2009 15:57:29 +0000 |
| Subject: | note 93493 deleted from function.get-magic-quotes-gpc by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160506@lists.php.net to get a copy of this message | ||
Note Submitter: gentoo at gmx dot de
----
Use the following to disable magic quotes:
<?php
// If magic-quotes is enabled, strip out slashes
if ( get_magic_quotes_gpc ( ) ) {
// function for removing slashes in arrays and strings
if ( ! function_exists ( 'stripslashes_deep' ) ) {
function stripslashes_deep ( $value ) {
return ( is_array ( $value ) ? array_map ( 'stripslashes_deep', $value ) : stripslashes
( $value ) ) ;
}
}
$_GET = array_map ( 'stripslashes_deep', $_GET ) ;
$_POST = array_map ( 'stripslashes_deep', $_POST ) ;
$_COOKIE = array_map ( 'stripslashes_deep', $_COOKIE ) ;
$_REQUEST = array_map ( 'stripslashes_deep', $_REQUEST ) ;
}
// Disable magic-quotes
@set_magic_quotes_runtime ( 0 ) ;
ini_set ( 'magic_quotes_sybase', 0 ) ;
?>