WordPress.org

Make WordPress Core

Changeset 31967


Ignore:
Timestamp:
04/01/2015 07:39:24 PM (5 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

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

    r31966 r31967  
    782782    $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string
    783783    if ( is_array( $args[0] ) ) {
    784         $kayvees = $args[0];
    785         $qs = array_replace( $qs, $kayvees );
     784        foreach ( $args[0] as $k => $v ) {
     785            $qs[ $k ] = $v;
     786        }
    786787    } else {
    787788        $qs[ $args[0] ] = $args[1];
Note: See TracChangeset for help on using the changeset viewer.