From 2e96b99ceb195735a641e299f3209840cc101052 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 23 Mar 2007 17:46:02 +0000 Subject: Ryan casts an int and catches a fish, someone buy him a pint! merge to 5092 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@933 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/formatting.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'wp-includes/formatting.php') diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index a36de22..a0c13db 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1072,6 +1072,11 @@ function clean_url( $url, $protocols = null ) { $strip = array('%0d', '%0a'); $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); + // Append http unless a relative link starting with / or a php file. + if ( strpos($url, '://') === false && + substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+.php/i', $url) ) + $url = 'http://' . $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) ) -- cgit