WordPress.org

Make WordPress Core

Ticket #4001: patch.diff

File patch.diff, 712 bytes (added by donncha, 7 years ago)
  • wp-includes/formatting.php

     
    10721072        $strip = array('%0d', '%0a'); 
    10731073        $url = str_replace($strip, '', $url); 
    10741074        $url = str_replace(';//', '://', $url); 
    1075         $url = (strpos($url, '://') === false) ? 'http://'.$url : $url; 
     1075        $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url; 
    10761076        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 
    10771077        if ( !is_array($protocols) ) 
    10781078                $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');