WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r30444 r29230  
    445445 */
    446446function wp_http_validate_url( $url ) {
    447     $original_url = $url;
    448447    $url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
    449     if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) )
     448    if ( ! $url )
    450449        return false;
    451450
     
    457456        return false;
    458457
    459     if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) )
     458    if ( false !== strpos( $parsed_url['host'], ':' ) )
    460459        return false;
    461460
     
    475474        if ( $ip ) {
    476475            $parts = array_map( 'intval', explode( '.', $ip ) );
    477             if ( 127 === $parts[0] || 10 === $parts[0]
     476            if ( '127.0.0.1' === $ip
     477                || ( 10 === $parts[0] )
    478478                || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
    479479                || ( 192 === $parts[0] && 168 === $parts[1] )
Note: See TracChangeset for help on using the changeset viewer.