Don't add http:// to relative links. Props donncha. fixes #4001
git-svn-id: https://develop.svn.wordpress.org/trunk@5065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7b297e825f
commit
b3727f5cb0
@ -1072,7 +1072,7 @@ function clean_url( $url, $protocols = null ) {
|
||||
$strip = array('%0d', '%0a');
|
||||
$url = str_replace($strip, '', $url);
|
||||
$url = str_replace(';//', '://', $url);
|
||||
$url = (strpos($url, '://') === false) ? 'http://'.$url : $url;
|
||||
$url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url;
|
||||
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
|
||||
if ( !is_array($protocols) )
|
||||
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
|
||||
|
Loading…
Reference in New Issue
Block a user