From: Alexander Ebert Date: Fri, 26 Oct 2012 13:34:09 +0000 (+0200) Subject: Removed $prependDir from HeaderUtil::redirect() X-Git-Tag: 2.0.0_Beta_1~833^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=147678ba609403ab26efc7565611560e6803dc7f;p=GitHub%2FWoltLab%2FWCF.git Removed $prependDir from HeaderUtil::redirect() You should always pass an URL returned by LinkHandler::getLink() which is already absolute by definition. --- 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);