[BUGFIX] Additional type checks and minor code improvements. 41/50341/3
authorMarc Willmann <mw@f7.de>
Mon, 24 Oct 2016 14:23:04 +0000 (16:23 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 26 Oct 2016 16:28:44 +0000 (18:28 +0200)
Resolves: #78402
Releases: master
Change-Id: I35b8555511a9560904048697c58e4f7a63b2023d
Reviewed-on: https://review.typo3.org/50341
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Daniel Lorenz <info@extco.de>
Tested-by: Daniel Lorenz <info@extco.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php

index 47d2c72..ed27b3e 100644 (file)
@@ -306,15 +306,19 @@ class ShortcutToolbarItem implements ToolbarItemInterface
             if (!is_array($this->moduleLoader->checkMod($moduleName))) {
                 continue;
             }
+            $pageId = $this->getLinkedPageId($row['url']);
+
             if (!$backendUser->isAdmin()) {
-                $pageId = $this->getLinkedPageId($row['url']);
                 if (MathUtility::canBeInterpretedAsInteger($pageId)) {
                     // Check for webmount access
-                    if (!$backendUser->isInWebMount($pageId)) {
+                    if ($backendUser->isInWebMount($pageId) === null) {
                         continue;
                     }
                     // Check for record access
                     $pageRow = BackendUtility::getRecord('pages', $pageId);
+                    if ($pageRow === null) {
+                        continue;
+                    }
                     if (!$backendUser->doesUserHaveAccess($pageRow, ($perms = 1))) {
                         continue;
                     }
@@ -665,7 +669,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface
         if (!empty($module) && !empty($url)) {
             $shortcutCreated = 'alreadyExists';
 
-            if (!BackendUtility::shortcutExists($url)) {
+            if (!BackendUtility::shortcutExists($url) && !is_array($module)) {
                 $shortcutCreated = $this->addShortcut($url, $shortcutName, $module);
             }
         }