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:
ryan 2007-03-21 00:29:40 +00:00
parent 25e7b34d7d
commit 0748c257f8
1 changed files with 1 additions and 1 deletions

View File

@ -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');