Revert "Url: Add support macros"

This reverts commit 33231d24da.
There is no need for url macros, since we're handling absolute
urls correctly now.
This commit is contained in:
Johannes Meyer 2015-09-22 15:51:00 +02:00
parent 33231d24da
commit 81e13109fc
1 changed files with 1 additions and 28 deletions

View File

@ -142,7 +142,7 @@ class Url
return $urlObject; return $urlObject;
} }
$urlParts = parse_url(static::resolveUrlMacros($url)); $urlParts = parse_url($url);
if (isset($urlParts['scheme']) && $urlParts['scheme'] !== $request->getScheme()) { if (isset($urlParts['scheme']) && $urlParts['scheme'] !== $request->getScheme()) {
$baseUrl = $urlParts['scheme'] . '://' . $urlParts['host'] . (isset($urlParts['port']) $baseUrl = $urlParts['scheme'] . '://' . $urlParts['host'] . (isset($urlParts['port'])
? (':' . $urlParts['port']) ? (':' . $urlParts['port'])
@ -189,33 +189,6 @@ class Url
return $urlObject; 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) * Create a new filter that needs to fullfill the base filter and the optional filter (if it exists)
* *