WordPress.org

Make WordPress Core

Changeset 17030


Ignore:
Timestamp:
12/17/2010 08:23:34 PM (7 years ago)
Author:
markjaquith
Message:

Do not add URL query args twice in certain Canonical Redirect situations. Use add_query_arg(). props filosofo. fixes #15774

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r16999 r17030  
    235235    $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
    236236    if ( $redirect_url && !empty($redirect['query']) ) {
    237         if ( strpos($redirect_url, '?') !== false )
    238             $redirect_url .= '&';
    239         else
    240             $redirect_url .= '?';
    241         $redirect_url .= $redirect['query'];
     237        parse_str( $redirect['query'], $_parsed_query );
     238        $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
    242239    }
    243240
Note: See TracChangeset for help on using the changeset viewer.