Removed $prependDir from HeaderUtil::redirect()
authorAlexander Ebert <ebert@woltlab.com>
Fri, 26 Oct 2012 13:34:09 +0000 (15:34 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 26 Oct 2012 13:34:09 +0000 (15:34 +0200)
You should always pass an URL returned by LinkHandler::getLink() which is already absolute by definition.

wcfsetup/install/files/lib/util/HeaderUtil.class.php

index 065700ea22d235b79352a0710baa01c9633fb38f..1c2b60aad1b904abcee935717af9799322602ad8 100644 (file)
@@ -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);