WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/01/2015 07:14:46 PM (6 years ago)
Author:
wonderboymusic
Message:

Respect numerical keys in add_query_arg(), use array_replace() instead of array_merge().

Adds unit test.

Props tyxla.
Fixes #31306.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r31891 r31966  
    783783    if ( is_array( $args[0] ) ) {
    784784        $kayvees = $args[0];
    785         $qs = array_merge( $qs, $kayvees );
     785        $qs = array_replace( $qs, $kayvees );
    786786    } else {
    787787        $qs[ $args[0] ] = $args[1];
Note: See TracChangeset for help on using the changeset viewer.