From f23b86d517e7812a34d4f51f7475af574bcbf8cb Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Fri, 22 Nov 2019 01:05:01 +0100
Subject: [PATCH] Fix add_magic_quotes()

Magic quotes are only relevant for string values. Anything non-string should be left untouched.
---
 src/wp-includes/functions.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 3ac199e1f0..fe12e9177b 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -1196,6 +1196,10 @@ function wp_removable_query_args() {
  */
 function add_magic_quotes( $array ) {
 	foreach ( (array) $array as $k => $v ) {
+		if ( ! is_string( $v ) ) {
+			continue;
+		}
+
 		if ( is_array( $v ) ) {
 			$array[ $k ] = add_magic_quotes( $v );
 		} else {
-- 
2.23.0.windows.1

