[BUGFIX] Add favicon without scheme 13/44213/5
authorStephan Großberndt <stephan@grossberndt.de>
Thu, 22 Oct 2015 08:48:42 +0000 (10:48 +0200)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Mon, 23 Nov 2015 19:50:35 +0000 (20:50 +0100)
Remove the scheme when rendering the link to a favicon in order to
avoid mixed content because the cached header of a page is used for
both HTTP and HTTPS.

Resolves: #69665
Releases: master, 6.2
Change-Id: I39d51bcf31a98369645d144f670e4d6200c2402d
Reviewed-on: https://review.typo3.org/44213
Reviewed-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Steffen Müller <typo3@t3node.com>
Tested-by: Steffen Müller <typo3@t3node.com>
Reviewed-by: Richard Haeser <richardhaeser@gmail.com>
Tested-by: Richard Haeser <richardhaeser@gmail.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Marcus Schwemer <ms@schwemer.de>
Tested-by: Marcus Schwemer <ms@schwemer.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/frontend/Classes/Page/PageGenerator.php

index a213277..0e8f3f4 100644 (file)
@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Type\File\ImageInfo;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -398,7 +399,7 @@ class PageGenerator
             $pageRenderer->setBaseUrl($tsfe->baseUrl);
         }
         if ($tsfe->pSetup['shortcutIcon']) {
-            $favIcon = $tsfe->tmpl->getFileName($tsfe->pSetup['shortcutIcon']);
+            $favIcon = ltrim($tsfe->tmpl->getFileName($tsfe->pSetup['shortcutIcon']), '/');
             $iconFileInfo = GeneralUtility::makeInstance(ImageInfo::class, PATH_site . $favIcon);
             if ($iconFileInfo->isFile()) {
                 $iconMimeType = $iconFileInfo->getMimeType();
@@ -406,7 +407,7 @@ class PageGenerator
                     $iconMimeType = ' type="' . $iconMimeType . '"';
                     $pageRenderer->setIconMimeType($iconMimeType);
                 }
-                $pageRenderer->setFavIcon(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $favIcon);
+                $pageRenderer->setFavIcon(PathUtility::getAbsoluteWebPath($tsfe->absRefPrefix . $favIcon));
             }
         }
         // Including CSS files