[BUGFIX] Fix broken ?? checks by adding required brackets 74/57174/4
authorFrank Naegler <frank.naegler@typo3.org>
Mon, 11 Jun 2018 09:11:53 +0000 (11:11 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 11 Jun 2018 10:23:40 +0000 (12:23 +0200)
Resolves: #85213
Related: #84993
Releases: master
Change-Id: Ib8cd46951cb5032a7554042e2d8a7a052102788b
Reviewed-on: https://review.typo3.org/57174
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php

index e95450c..c3117ac 100644 (file)
@@ -307,21 +307,21 @@ class FileListController extends ActionController
         // Set predefined value for DisplayBigControlPanel:
         $backendUser = $this->getBackendUser();
         $userTsConfig = $backendUser->getTSConfig();
-        if ($userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '' === 'activated') {
+        if (($userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '') === 'activated') {
             $this->MOD_SETTINGS['bigControlPanel'] = true;
-        } elseif ($userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '' === 'deactivated') {
+        } elseif (($userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '') === 'deactivated') {
             $this->MOD_SETTINGS['bigControlPanel'] = false;
         }
         // Set predefined value for DisplayThumbnails:
-        if ($userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '' === 'activated') {
+        if (($userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '') === 'activated') {
             $this->MOD_SETTINGS['displayThumbs'] = true;
-        } elseif ($userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '' === 'deactivated') {
+        } elseif (($userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '') === 'deactivated') {
             $this->MOD_SETTINGS['displayThumbs'] = false;
         }
         // Set predefined value for Clipboard:
-        if ($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '' === 'activated') {
+        if (($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'activated') {
             $this->MOD_SETTINGS['clipBoard'] = true;
-        } elseif ($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '' === 'deactivated') {
+        } elseif (($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'deactivated') {
             $this->MOD_SETTINGS['clipBoard'] = false;
         }
         // If user never opened the list module, set the value for displayThumbs
@@ -435,7 +435,7 @@ class FileListController extends ActionController
 
             $this->view->assign('checkboxes', [
                 'bigControlPanel' => [
-                    'enabled' => $userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '' === 'selectable',
+                    'enabled' => ($userTsConfig['options.']['file_list.']['enableDisplayBigControlPanel'] ?? '') === 'selectable',
                     'label' => htmlspecialchars($this->getLanguageService()->getLL('bigControlPanel')),
                     'html' => BackendUtility::getFuncCheck(
                         $this->id,
@@ -447,7 +447,7 @@ class FileListController extends ActionController
                     ),
                 ],
                 'displayThumbs' => [
-                    'enabled' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '' === 'selectable',
+                    'enabled' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && ($userTsConfig['options.']['file_list.']['enableDisplayThumbnails'] ?? '') === 'selectable',
                     'label' => htmlspecialchars($this->getLanguageService()->getLL('displayThumbs')),
                     'html' => BackendUtility::getFuncCheck(
                         $this->id,
@@ -459,7 +459,7 @@ class FileListController extends ActionController
                     ),
                 ],
                 'enableClipBoard' => [
-                    'enabled' => $userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '' === 'selectable',
+                    'enabled' => ($userTsConfig['options.']['file_list.']['enableClipBoard'] ?? '') === 'selectable',
                     'label' => htmlspecialchars($this->getLanguageService()->getLL('clipBoard')),
                     'html' => BackendUtility::getFuncCheck(
                         $this->id,
index 5ad45e4..57f2220 100644 (file)
@@ -108,7 +108,7 @@ class UriViewHelper extends AbstractViewHelper
         if ($arguments['action'] ?? false) {
             $parameters['action'] = $arguments['action'];
         }
-        if ($arguments['format'] ?? '' !== '') {
+        if (($arguments['format'] ?? '') !== '') {
             $parameters['format'] = $arguments['format'];
         }
         return $uriBuilder->reset()