WordPress.org

Make WordPress Core

Changeset 18469


Ignore:
Timestamp:
07/26/2011 07:44:18 PM (7 years ago)
Author:
ryan
Message:

Recognize urls that start with a question mark as relative urls that do not require a scheme to be prepended. fixes #18260

File:
1 edited

Legend:

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

    r18465 r18469  
    22572257    /* If the URL doesn't appear to contain a scheme, we
    22582258     * presume it needs http:// appended (unless a relative
    2259      * link starting with / or a php file).
     2259     * link starting with /, # or ? or a php file).
    22602260     */
    2261     if ( strpos($url, ':') === false &&
    2262         substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '#' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
     2261    if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
     2262        ! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
    22632263        $url = 'http://' . $url;
    22642264
Note: See TracChangeset for help on using the changeset viewer.