From a143f7f03b41c80c246d81b8e4cb92377de93c99 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 1 Apr 2015 19:39:24 +0000 Subject: [PATCH] Avoid the use of `array_replace()` in `add_query_arg()`. `array_replace()` was introduced PHP 5.3+. Instead, we walk the array manually. See [31966]. Fixes #31306. git-svn-id: https://develop.svn.wordpress.org/trunk@31967 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 42f6873b64..388922cb90 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -781,8 +781,9 @@ function add_query_arg() { wp_parse_str( $query, $qs ); $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string if ( is_array( $args[0] ) ) { - $kayvees = $args[0]; - $qs = array_replace( $qs, $kayvees ); + foreach ( $args[0] as $k => $v ) { + $qs[ $k ] = $v; + } } else { $qs[ $args[0] ] = $args[1]; }