[BUGFIX] "Show page" does not use a proper URL scheme
authorDmitry Dulepov <dmitry@typo3.org>
Mon, 21 Nov 2011 12:16:35 +0000 (14:16 +0200)
committerDmitry Dulepov <dmitry@typo3.org>
Mon, 6 Feb 2012 12:42:30 +0000 (13:42 +0100)
"Show page" context menu and Web>View do not use proper scheme if
that is set in the page properties. They always use the scheme of
the Backend.

Change-Id: I3e700ecee13e0fb47317170dd2388cce627601fb
Fixes: #31959
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7412
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
t3lib/class.t3lib_befunc.php
typo3/sysext/viewpage/view/index.php

index 47ffd99..82da937 100644 (file)
@@ -2976,8 +2976,16 @@ final class t3lib_BEfunc {
                if (count($rootLine) > 0) {
                        $urlParts = parse_url($domain);
                        if (self::getDomainStartPage($urlParts['host'], $urlParts['path'])) {
-                               $protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
-                               $domain = $protocol . self::firstDomainRecord($rootLine);
+                               /** @var t3lib_pageSelect $sysPage */
+                               $sysPage = t3lib_div::makeInstance('t3lib_pageSelect');
+
+                               $page = (array)$sysPage->getPage($pageId);
+                               $protocol = 'http';
+                               if ($page['url_scheme'] == t3lib_utility_Http::SCHEME_HTTPS || ($page['url_scheme'] == 0 && t3lib_div::getIndpEnv('TYPO3_SSL'))) {
+                                       $protocol = 'https';
+                               }
+
+                               $domain = $protocol . '://' . self::firstDomainRecord($rootLine);
                        }
                }
 
index 644ecab..5ed22ad 100755 (executable)
@@ -115,6 +115,7 @@ class SC_mod_web_view_index {
                                                '';
 
                        // preview of mount pages
+               /** @var t3lib_pageSelect $sys_page */
                $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
                $sys_page->init(FALSE);
                $mountPointInfo = $sys_page->getMountPointInfo($this->id);
@@ -123,7 +124,17 @@ class SC_mod_web_view_index {
                        $addCmd .= '&MP=' . $mountPointInfo['MPvar'];
                }
 
-               $this->url.= ($dName?(t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$dName:$BACK_PATH.'..').'/index.php?id='.$this->id.($this->type?'&type='.$this->type:'').$addCmd;
+               $page = (array)$sys_page->getPage($this->id);
+
+               $urlScheme = 'http';
+               if ($page['url_scheme'] == 2 || $page['url_scheme'] == 0 && t3lib_div::getIndpEnv('TYPO3_SSL')) {
+                       $urlScheme = 'https';
+               }
+
+               $this->url .= ($dName
+                               ? $urlScheme . '://' . $dName
+                               : $BACK_PATH . '..') . '/index.php?id=' . $this->id .
+                                       ($this->type ? '&type=' . $this->type : '') . $addCmd;
        }
 
        /**
@@ -149,4 +160,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
+?>
\ No newline at end of file