[BUGFIX] Pages with Enforce Protocol (SSL) may generate wrong URL
authorSteffen Ritter <info@rs-websystems.de>
Tue, 1 Mar 2011 12:56:43 +0000 (13:56 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Sat, 12 Mar 2011 07:08:27 +0000 (08:08 +0100)
If TYPO3 is installed in a subfolder, you won't need a absRefPrefix set because normally links are relative.
If a Protocol change will (SSL -> PLAIN or vice versa) happen, the URL has to be generated absolute.
This will fail in the described behaviour.

Notes:
This one has been reported by Michael Maier.
Attached patch is my "easier to read" version doing the same as _v2 of Jigal and the result of talking through all cases which may arise.

Resolves: #M17118
Master Branch: Ie5821361b578b6f1fa3612ac9bfa44dd476c9c76

Change-Id: I63834ee565ad2958a3af82bcd03537e053832c09
Reviewed-on: http://review.typo3.org/957
Reviewed-by: Jigal van Hemert <jigal@xs4all.nl>
Tested-by: Jigal van Hemert <jigal@xs4all.nl>
typo3/sysext/cms/tslib/class.tslib_content.php

index 34c0e1e..6641235 100644 (file)
@@ -5762,6 +5762,11 @@ class tslib_cObj {
                                                                        $absoluteUrlScheme !== parse_url(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME)) {
                                                                $targetDomain = $currentDomain;
                                                        }
+
+                                                               // If go for an absolute link, add site_path if it's not taken care about by absRefPrefix
+                                                       if (!$GLOBALS['TSFE']->config['config']['absRefPrefix'] && $targetDomain !== '') {
+                                                               $targetDomain = $currentDomain . rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_PATH'), '/');
+                                                       }
                                                }
 
                                                        // If target page has a different domain and the current domain's linking scheme (e.g. simulateStaticDocuments/RealURL/...) should not be used