[BUGFIX] pageNotFound_handling error with relative paths
authorMarkus Klein <klein.t3@mfc-linz.at>
Sat, 21 May 2011 14:52:22 +0000 (16:52 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Mon, 6 Jun 2011 14:29:01 +0000 (16:29 +0200)
This patch fixes the handling of relative paths of pageNotFound_handling.
Due to a missing check, the relative path is prefixed with http_host only,
causing a wrong Location header.

Change-Id: I664250d34b05a26bdaf1e2a839027b80c1e4f607
Resolves: #25725
Releases: 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/1712
Reviewed-by: Kurt Kunig
Tested-by: Kurt Kunig
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
typo3/sysext/cms/tslib/class.tslib_fe.php

index dfcfd84..6b85508 100644 (file)
                        $url_parts = parse_url($code);
                        if ($url_parts['host'] == '')   {
                                $url_parts['host'] = t3lib_div::getIndpEnv('HTTP_HOST');
-                               $code = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') . $code;
+                               if ($code{0} === '/') {
+                                       $code = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') . $code;
+                               } else {
+                                       $code = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') . $code;
+                               }
                                $checkBaseTag = FALSE;
                        } else {
                                $checkBaseTag = TRUE;
@@ -4976,4 +4980,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/class.tslib_fe.php']);
 }
 
-?>
\ No newline at end of file
+?>