Commit ccf7dae5 authored by Wouter Wolters's avatar Wouter Wolters
Browse files

[BUGFIX] Double protocol when using TCEMAIN.previewDomain

In EXT:viewpage the option TCEMAIN.previewDomain is used but
not evaluated correctly. The option can contain the protocol
already and this is not respected in EXT:viewpage.

Check if domain already contains a protocol.

Resolves: #34820
Resolves: #36542
Resolves: #23115
Releases: master, 6.2
Change-Id: I13f7cda1dca54d60d350ba460e43ec924c140d35
Reviewed-on: http://review.typo3.org/41095


Reviewed-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Tested-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 30e524b9
......@@ -68,15 +68,19 @@ class ViewModuleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionContr
// Modify relative path to protocol with host if domain record is given
$protocolAndHost = '..';
if ($domainName) {
$protocol = 'http';
$page = (array)$sysPage->getPage($finalPageIdToShow);
if ($page['url_scheme'] == 2 || $page['url_scheme'] == 0 && \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$protocol = 'https';
// TCEMAIN.previewDomain can contain the protocol, check prevents double protocol URLs
if (strpos($domainName, '://') !== FALSE) {
$protocolAndHost = $domainName;
} else {
$protocol = 'http';
$page = (array)$sysPage->getPage($finalPageIdToShow);
if ($page['url_scheme'] == 2 || $page['url_scheme'] == 0 && \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$protocol = 'https';
}
$protocolAndHost = $protocol . '://' . $domainName;
}
$protocolAndHost = $protocol . '://' . $domainName;
}
$url = $protocolAndHost . '/index.php?id=' . $finalPageIdToShow . $this->getTypeParameterIfSet($finalPageIdToShow) . $mountPointMpParameter . $adminCommand;
return $url;
return $protocolAndHost . '/index.php?id=' . $finalPageIdToShow . $this->getTypeParameterIfSet($finalPageIdToShow) . $mountPointMpParameter . $adminCommand;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment