diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 411eaa8601..57cfcb1eac 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3239,7 +3239,7 @@ function tag_escape($tag_name) { * @return string Absolute path. */ function wp_make_link_relative( $link ) { - return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link ); + return preg_replace( '|^(https?:)?//[^/]+(/.*)|i', '$2', $link ); } /**