Don't add http:// to relative links. Props donncha. fixes #4001
git-svn-id: http://svn.automattic.com/wordpress/trunk@5065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
25e7b34d7d
commit
0748c257f8
|
@ -1072,7 +1072,7 @@ function clean_url( $url, $protocols = null ) {
|
||||||
$strip = array('%0d', '%0a');
|
$strip = array('%0d', '%0a');
|
||||||
$url = str_replace($strip, '', $url);
|
$url = str_replace($strip, '', $url);
|
||||||
$url = str_replace(';//', '://', $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);
|
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
|
||||||
if ( !is_array($protocols) )
|
if ( !is_array($protocols) )
|
||||||
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
|
$protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
|
||||||
|
|
Loading…
Reference in New Issue