Make WordPress Core


Ignore:
Timestamp:
06/22/2006 03:52:18 AM (18 years ago)
Author:
ryan
Message:

Fix bug in add_query_arg when url like http://example.com (no trailing slash). Props skel to the ac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/functions.php

    r3856 r3898  
    20842084    }
    20852085
     2086    if ( preg_match('|^https?://|i', $uri, $matches) ) {
     2087        $protocol = $matches[0];
     2088        $uri = substr($uri, strlen($protocol));
     2089    } else {
     2090        $protocol = '';
     2091    }
     2092
    20862093    if ( strstr($uri, '?') ) {
    20872094        $parts = explode('?', $uri, 2);
     
    20932100            $query = $parts[1];
    20942101        }
    2095     }
    2096     else if ( strstr($uri, '/') ) {
     2102    } else if ( !empty($protocol) || strstr($uri, '/') ) {
    20972103        $base = $uri . '?';
    20982104        $query = '';
Note: See TracChangeset for help on using the changeset viewer.