[BUGFIX] pageNotFound_handling error with relative paths
authorMarkus Klein <klein.t3@mfc-linz.at>
Sat, 21 May 2011 15:00:40 +0000 (17:00 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Mon, 6 Jun 2011 15:04:00 +0000 (17:04 +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: Ibf19841a984aaef863cdb72392b09b631e4f39e5
Resolves: #25725
Releases: 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/2281
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 0a62369..9a009bf 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;