WordPress.org

Make WordPress Core

Ticket #18260: 18260.diff

File 18260.diff, 860 bytes (added by ryan, 7 years ago)
  • wp-includes/formatting.php

     
    22562256        $url = str_replace(';//', '://', $url);
    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         */
    22612261        if ( strpos($url, ':') === false &&
    2262                 substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '#' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
     2262                substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '?' &&
     2263                substr( $url, 0, 1 ) != '#' &&
     2264                !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
    22632265                $url = 'http://' . $url;
    22642266
    22652267        // Replace ampersands and single quotes only when displaying.