Make WordPress Core

Ticket #21974: 21974.3.patch

File 21974.3.patch, 753 bytes (added by SergeyBiryukov, 12 years ago)
  • wp-includes/formatting.php

     
    26322632
    26332633        if ( ! is_array( $protocols ) )
    26342634                $protocols = wp_allowed_protocols();
    2635         $good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
    2636         if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
    2637                 return '';
    26382635
     2636        if ( '/' != $url[0] ) {
     2637                $good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
     2638                if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
     2639                        return '';
     2640        } else {
     2641                $good_protocol_url = $url;
     2642        }
     2643
    26392644        return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
    26402645}
    26412646