note 93493 added to function.get-magic-quotes-gpc
| From: | gentoo at gmx dot de | Date: | Sat, 12 Sep 2009 20:13:51 +0000 |
| Subject: | note 93493 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160496@lists.php.net to get a copy of this message | ||
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 ) ;
?>
----
Server IP: 217.160.72.57
Probable Submitter: 217.85.191.32
----
Manual Page -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php
Edit -- https://master.php.net/note/edit/93493
Del: integrated -- https://master.php.net/note/delete/93493/integrated
Del: useless -- https://master.php.net/note/delete/93493/useless
Del: bad code -- https://master.php.net/note/delete/93493/bad+code
Del: spam -- https://master.php.net/note/delete/93493/spam
Del: non-english -- https://master.php.net/note/delete/93493/non-english
Del: in docs -- https://master.php.net/note/delete/93493/in+docs
Del: other reasons-- https://master.php.net/note/delete/93493
Reject -- https://master.php.net/note/reject/93493
Search -- https://master.php.net/manage/user-notes.php