[BUGFIX] Avoid PHP warning in TypoScriptFrontendController 85/31685/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 7 Jul 2014 21:05:36 +0000 (23:05 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 19 Jul 2014 16:25:03 +0000 (18:25 +0200)
TypoScriptFrontendController throws a PHP warning on access to
$BE_USER->user['uid'] which might not be set.
Fix this by simply adding an empty() check.

Resolves: #60126
Releases: 6.3, 6.2
Change-Id: I7005baf73bce55d862b4b6b61697c2aa0a877c7b
Reviewed-on: https://review.typo3.org/31685
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 177b6cf..58b39b0 100644 (file)
@@ -1265,12 +1265,12 @@ class TypoScriptFrontendController {
                        // Object is initialized
                        $BE_USER->start();
                        $BE_USER->unpack_uc('');
-                       if ($BE_USER->user['uid']) {
+                       if (!empty($BE_USER->user['uid'])) {
                                $BE_USER->fetchGroupData();
                                $this->beUserLogin = TRUE;
                        }
                        // Unset the user initialization.
-                       if (!$BE_USER->checkLockToIP() || !$BE_USER->checkBackendAccessSettingsFromInitPhp() || !$BE_USER->user['uid']) {
+                       if (!$BE_USER->checkLockToIP() || !$BE_USER->checkBackendAccessSettingsFromInitPhp() || empty($BE_USER->user['uid'])) {
                                $BE_USER = NULL;
                                $this->beUserLogin = FALSE;
                                $_SESSION['TYPO3-TT-start'] = FALSE;