From 81e13109fc47444b568d5e0cf1b7bc295736117e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 22 Sep 2015 15:51:00 +0200 Subject: [PATCH] Revert "Url: Add support macros" This reverts commit 33231d24dab942b31c924c4c8e352dd73f80939b. There is no need for url macros, since we're handling absolute urls correctly now. --- library/Icinga/Web/Url.php | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php index 617ac7a4e..6f39bbab7 100644 --- a/library/Icinga/Web/Url.php +++ b/library/Icinga/Web/Url.php @@ -142,7 +142,7 @@ class Url return $urlObject; } - $urlParts = parse_url(static::resolveUrlMacros($url)); + $urlParts = parse_url($url); if (isset($urlParts['scheme']) && $urlParts['scheme'] !== $request->getScheme()) { $baseUrl = $urlParts['scheme'] . '://' . $urlParts['host'] . (isset($urlParts['port']) ? (':' . $urlParts['port']) @@ -189,33 +189,6 @@ class Url return $urlObject; } - /** - * Return the given url with all macros being resolved - * - * @param string $url - * - * @return string - */ - public static function resolveUrlMacros($url) - { - $serverName = static::getRequest()->getServer('SERVER_NAME'); - $macros = array( - 'HTTP_AUTHORITY' => 'http://' . $serverName, - 'HTTPS_AUTHORITY' => 'https://' . $serverName - ); - - if (preg_match_all('@\$([^\$\s]+)\$@', $url, $matches)) { - foreach ($matches[1] as $macroIndex => $macroName) { - if (isset($macros[$macroName])) { - $placeholder = $matches[0][$macroIndex]; - $url = str_replace($placeholder, $macros[$macroName], $url); - } - } - } - - return $url; - } - /** * Create a new filter that needs to fullfill the base filter and the optional filter (if it exists) *