[BUGFIX] Set active SCHEME using typolink with forceAbsoluteUrl 89/21589/2
authorFerdinand Kuhl <fcool@coolys.de>
Thu, 20 Jun 2013 16:28:24 +0000 (18:28 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 9 Nov 2013 16:37:21 +0000 (17:37 +0100)
If you use forceAbsoluteUrl at a page which has "default" as option and
is called per https the link will be generated with "http" - and not as
"default" means with the active protocol.
This patch fixes that behaviour.

Resolves: #49293
Releases: 4.5, 4.7, 6.0, 6.1, 6.2
Change-Id: Iab087469f63a63267213d9f1c4fc45223b7f45dc
Reviewed-on: https://review.typo3.org/21589
Reviewed-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 016d597..8756618 100644 (file)
@@ -6093,6 +6093,8 @@ class ContentObjectRenderer {
                                                                $absoluteUrlScheme = $conf['forceAbsoluteUrl.']['scheme'];
                                                        } elseif ($page['url_scheme'] > 0) {
                                                                $absoluteUrlScheme = (int) $page['url_scheme'] === \TYPO3\CMS\Core\Utility\HttpUtility::SCHEME_HTTP ? 'http' : 'https';
                                                                $absoluteUrlScheme = $conf['forceAbsoluteUrl.']['scheme'];
                                                        } elseif ($page['url_scheme'] > 0) {
                                                                $absoluteUrlScheme = (int) $page['url_scheme'] === \TYPO3\CMS\Core\Utility\HttpUtility::SCHEME_HTTP ? 'http' : 'https';
+                                                       } elseif (t3lib_div::getIndpEnv('TYPO3_SSL')) {
+                                                               $absoluteUrlScheme = 'https';
                                                        }
                                                        // If no domain records are defined, use current domain:
                                                        $currentUrlScheme = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME);
                                                        }
                                                        // If no domain records are defined, use current domain:
                                                        $currentUrlScheme = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME);