From 147678ba609403ab26efc7565611560e6803dc7f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 26 Oct 2012 15:34:09 +0200 Subject: [PATCH] Removed $prependDir from HeaderUtil::redirect() You should always pass an URL returned by LinkHandler::getLink() which is already absolute by definition. --- .../install/files/lib/util/HeaderUtil.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/util/HeaderUtil.class.php b/wcfsetup/install/files/lib/util/HeaderUtil.class.php index 065700ea22..1c2b60aad1 100644 --- a/wcfsetup/install/files/lib/util/HeaderUtil.class.php +++ b/wcfsetup/install/files/lib/util/HeaderUtil.class.php @@ -88,20 +88,9 @@ final class HeaderUtil { * Redirects the user agent. * * @param string $location - * @param boolean $prependDir * @param boolean $sendStatusCode */ - public static function redirect($location, $prependDir = true, $sendStatusCode = false) { - if ($prependDir) { - // remove path info from request URI - $requestURI = WCF::getSession()->requestURI; - if (($pos = strpos($requestURI, '.php')) !== false) { - $requestURI = substr($requestURI, 0, ($pos + 4)); - } - - $location = FileUtil::addTrailingSlash(FileUtil::unifyDirSeperator(dirname($requestURI))) . $location; - } - + public static function redirect($location, $sendStatusCode = false) { //if ($sendStatusCode) @header('HTTP/1.0 301 Moved Permanently'); if ($sendStatusCode) @header('HTTP/1.1 307 Temporary Redirect'); header('Location: '.$location); -- 2.20.1