[BUGFIX] Pages with Enforce Protocol (SSL) may generate wrong URL
authorSteffen Ritter <info@rs-websystems.de>
Tue, 1 Mar 2011 12:42:24 +0000 (13:42 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Thu, 10 Mar 2011 08:01:26 +0000 (09:01 +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.

Change-Id: Ie5821361b578b6f1fa3612ac9bfa44dd476c9c76
Resolves: #M17118
Reviewed-on: http://review.typo3.org/953
Reviewed-by: Tobias Liebig <mail_typo3.org@etobi.de>
Reviewed-by: Andreas Wolf <andreas.wolf@ikt-werk.de>
Tested-by: Andreas Wolf <andreas.wolf@ikt-werk.de>
Reviewed-by: Sebastian Fischer <typo3@evoweb.de>
Reviewed-by: Helmut Hummel <typo3@helmut-hummel.de>
Tested-by: Helmut Hummel <typo3@helmut-hummel.de>
Reviewed-by: Jigal van Hemert <jigal@xs4all.nl>
typo3/sysext/cms/tslib/class.tslib_content.php

index edbb6fd..36483d7 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