mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Stripslashes doesn't work on arrays. Add stripslashes_deep(). Props: Mike Little
git-svn-id: http://svn.automattic.com/wordpress/trunk@2700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
91efba11ad
commit
6cbb6fecb3
@ -532,6 +532,16 @@ function addslashes_gpc($gpc) {
|
|||||||
return $wpdb->escape($gpc);
|
return $wpdb->escape($gpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function stripslashes_deep($value)
|
||||||
|
{
|
||||||
|
$value = is_array($value) ?
|
||||||
|
array_map('stripslashes_deep', $value) :
|
||||||
|
stripslashes($value);
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
function antispambot($emailaddy, $mailto=0) {
|
function antispambot($emailaddy, $mailto=0) {
|
||||||
$emailNOSPAMaddy = '';
|
$emailNOSPAMaddy = '';
|
||||||
srand ((float) microtime() * 1000000);
|
srand ((float) microtime() * 1000000);
|
||||||
|
@ -138,10 +138,10 @@ require_once(ABSPATH . WPINC . '/locale.php');
|
|||||||
|
|
||||||
// If already slashed, strip.
|
// If already slashed, strip.
|
||||||
if ( get_magic_quotes_gpc() ) {
|
if ( get_magic_quotes_gpc() ) {
|
||||||
$_GET = stripslashes($_GET );
|
$_GET = stripslashes_deep($_GET );
|
||||||
$_POST = stripslashes($_POST );
|
$_POST = stripslashes_deep($_POST );
|
||||||
$_COOKIE = stripslashes($_COOKIE);
|
$_COOKIE = stripslashes_deep($_COOKIE);
|
||||||
$_SERVER = stripslashes($_SERVER);
|
$_SERVER = stripslashes_deep($_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape with wpdb.
|
// Escape with wpdb.
|
||||||
|
Loading…
Reference in New Issue
Block a user