From c113cb51305f46bc967c255989a85796878ccb6a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 1 Apr 2015 19:15:31 +0000 Subject: [PATCH] Respect numerical keys in `add_query_arg()`, use `array_replace()` instead of `array_merge()`. Adds unit test. Props tyxla. Fixes #31306. Built from https://develop.svn.wordpress.org/trunk@31966 git-svn-id: http://core.svn.wordpress.org/trunk@31945 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index fbe1219866..42f6873b64 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -782,7 +782,7 @@ function add_query_arg() { $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_merge( $qs, $kayvees ); + $qs = array_replace( $qs, $kayvees ); } else { $qs[ $args[0] ] = $args[1]; } diff --git a/wp-includes/version.php b/wp-includes/version.php index c45d6c3a6a..b9e6605b4f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta3-31965'; +$wp_version = '4.2-beta3-31966'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.