mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Only run stripslashes() in stripslashes_deep() for strings, not other scalar values. props Kawauso, knutsp. props coffee2code for [UT698]. fixes #18026.
git-svn-id: http://core.svn.wordpress.org/trunk@21292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dcb200efc9
commit
81ae841eba
@ -1380,8 +1380,8 @@ function addslashes_gpc($gpc) {
|
|||||||
*
|
*
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*
|
*
|
||||||
* @param array|string $value The array or string to be stripped.
|
* @param mixed $value The value to be stripped.
|
||||||
* @return array|string Stripped array (or string in the callback).
|
* @return mixed Stripped value.
|
||||||
*/
|
*/
|
||||||
function stripslashes_deep($value) {
|
function stripslashes_deep($value) {
|
||||||
if ( is_array($value) ) {
|
if ( is_array($value) ) {
|
||||||
@ -1391,7 +1391,7 @@ function stripslashes_deep($value) {
|
|||||||
foreach ($vars as $key=>$data) {
|
foreach ($vars as $key=>$data) {
|
||||||
$value->{$key} = stripslashes_deep( $data );
|
$value->{$key} = stripslashes_deep( $data );
|
||||||
}
|
}
|
||||||
} else {
|
} elseif ( is_string( $value ) ) {
|
||||||
$value = stripslashes($value);
|
$value = stripslashes($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user