[BUGFIX] Type safe check for $BE_USER in index_ts.php 63/27463/3
authorŁukas Jurys <lukasz.jurys@me.com>
Sat, 8 Feb 2014 15:05:05 +0000 (16:05 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 8 Feb 2014 19:04:14 +0000 (20:04 +0100)
Resolves: #41593
Releases: 6.2
Change-Id: I3863789ad2489055169f3f008cb4dac0085fde82
Reviewed-on: https://review.typo3.org/27463
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Marcin Sągol
Reviewed-by: Michał Jankiewicz
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/cms/tslib/index_ts.php

index 28c6cfd..0c7c537 100644 (file)
@@ -253,11 +253,17 @@ $TT->pull();
 \TYPO3\CMS\Core\Utility\MonitorUtility::peakMemoryUsage();
 // beLoginLinkIPList
 echo $TSFE->beLoginLinkIPList();
 \TYPO3\CMS\Core\Utility\MonitorUtility::peakMemoryUsage();
 // beLoginLinkIPList
 echo $TSFE->beLoginLinkIPList();
+
 // Admin panel
 // Admin panel
-if (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->isBackendUserLoggedIn()) {
+if (
+       $TSFE->isBackendUserLoggedIn()
+       && $BE_USER instanceof \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
+       && $BE_USER->isAdminPanelVisible()
+) {
        $TSFE->content = str_ireplace('</head>', $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
        $TSFE->content = str_ireplace('</body>', $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
 }
        $TSFE->content = str_ireplace('</head>', $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
        $TSFE->content = str_ireplace('</body>', $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
 }
+
 if ($sendTSFEContent) {
        echo $TSFE->content;
 }
 if ($sendTSFEContent) {
        echo $TSFE->content;
 }