From 7f88525175c3248c7ef821911beab4b2808e8c39 Mon Sep 17 00:00:00 2001 From: Foxaii Date: Fri, 13 Dec 2013 17:42:21 +0000 Subject: [PATCH] Port support for rel urls --- lib/relative-urls.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/relative-urls.php b/lib/relative-urls.php index 56ee615..843f166 100644 --- a/lib/relative-urls.php +++ b/lib/relative-urls.php @@ -13,7 +13,9 @@ function roots_root_relative_url($input) { preg_match('|https?://([^/]+)(/.*)|i', $input, $matches); - if (isset($matches[1]) && isset($matches[2]) && $matches[1] === $_SERVER['SERVER_NAME']) { + if (!isset($matches[1]) || !isset($matches[2])) { + return $input; + } elseif (($matches[1] === $server_name) || $matches[1] === $server_name . ':' . $_SERVER['SERVER_PORT']) { return wp_make_link_relative($input); } else { return $input;