diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 3c9adb68d9..931329951f 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2004,7 +2004,7 @@ function clean_url( $url, $protocols = null, $context = 'display' ) { * link starting with / or a php file). */ if ( strpos($url, ':') === false && - substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) + substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '#' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) $url = 'http://' . $url; // Replace ampersands and single quotes only when displaying.