Commit eac7d30c authored by Tymoteusz Motylewski's avatar Tymoteusz Motylewski Committed by Andreas Fernandez
Browse files

[BUGFIX] Fix notices in Filelist module

Resolves: #83002
Releases: master
Change-Id: I06c09f282df7fdcc0d8af11d65c5113f33a9c849
Reviewed-on: https://review.typo3.org/54651


Reviewed-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
parent 67a7dddc
...@@ -370,7 +370,7 @@ class Clipboard ...@@ -370,7 +370,7 @@ class Clipboard
public function getContentFromTab($pad) public function getContentFromTab($pad)
{ {
$lines = []; $lines = [];
if (is_array($this->clipData[$pad]['el'])) { if (is_array($this->clipData[$pad]['el'] ?? false)) {
foreach ($this->clipData[$pad]['el'] as $k => $v) { foreach ($this->clipData[$pad]['el'] as $k => $v) {
if ($v) { if ($v) {
list($table, $uid) = explode('|', $k); list($table, $uid) = explode('|', $k);
...@@ -752,7 +752,7 @@ class Clipboard ...@@ -752,7 +752,7 @@ class Clipboard
$params = []; $params = [];
$params['tx_impexp']['action'] = 'export'; $params['tx_impexp']['action'] = 'export';
// Traverse items: // Traverse items:
if (is_array($this->clipData[$pad]['el'])) { if (is_array($this->clipData[$pad]['el'] ?? false)) {
foreach ($this->clipData[$pad]['el'] as $k => $v) { foreach ($this->clipData[$pad]['el'] as $k => $v) {
if ($v) { if ($v) {
list($table, $uid) = explode('|', $k); list($table, $uid) = explode('|', $k);
...@@ -808,7 +808,7 @@ class Clipboard ...@@ -808,7 +808,7 @@ class Clipboard
*/ */
public function currentMode() public function currentMode()
{ {
return $this->clipData[$this->current]['mode'] === 'copy' ? 'copy' : 'cut'; return ($this->clipData[$this->current]['mode'] ?? '') === 'copy' ? 'copy' : 'cut';
} }
/** /**
...@@ -817,7 +817,7 @@ class Clipboard ...@@ -817,7 +817,7 @@ class Clipboard
*/ */
public function cleanCurrent() public function cleanCurrent()
{ {
if (is_array($this->clipData[$this->current]['el'])) { if (is_array($this->clipData[$this->current]['el'] ?? false)) {
foreach ($this->clipData[$this->current]['el'] as $k => $v) { foreach ($this->clipData[$this->current]['el'] as $k => $v) {
list($table, $uid) = explode('|', $k); list($table, $uid) = explode('|', $k);
if ($table !== '_FILE') { if ($table !== '_FILE') {
...@@ -853,7 +853,7 @@ class Clipboard ...@@ -853,7 +853,7 @@ class Clipboard
{ {
$pad = $pad ? $pad : $this->current; $pad = $pad ? $pad : $this->current;
$list = []; $list = [];
if (is_array($this->clipData[$pad]['el'])) { if (is_array($this->clipData[$pad]['el'] ?? false)) {
foreach ($this->clipData[$pad]['el'] as $k => $v) { foreach ($this->clipData[$pad]['el'] as $k => $v) {
if ($v) { if ($v) {
list($table, $uid) = explode('|', $k); list($table, $uid) = explode('|', $k);
...@@ -883,7 +883,7 @@ class Clipboard ...@@ -883,7 +883,7 @@ class Clipboard
public function isSelected($table, $uid) public function isSelected($table, $uid)
{ {
$k = $table . '|' . $uid; $k = $table . '|' . $uid;
return $this->clipData[$this->current]['el'][$k] ? ($this->current === 'normal' ? $this->currentMode() : 1) : ''; return !empty($this->clipData[$this->current]['el'][$k]) ? ($this->current === 'normal' ? $this->currentMode() : 1) : '';
} }
/** /**
......
...@@ -57,7 +57,7 @@ class MetaInformation ...@@ -57,7 +57,7 @@ class MetaInformation
$pageRecord = $this->recordArray; $pageRecord = $this->recordArray;
$title = ''; $title = '';
// Is this a real page // Is this a real page
if (is_array($pageRecord) && $pageRecord['uid']) { if (is_array($pageRecord) && !empty($pageRecord['uid'])) {
$title = substr($pageRecord['_thePathFull'], 0, -1); $title = substr($pageRecord['_thePathFull'], 0, -1);
// Remove current page title // Remove current page title
$pos = strrpos($title, $pageRecord['title']); $pos = strrpos($title, $pageRecord['title']);
...@@ -174,7 +174,7 @@ class MetaInformation ...@@ -174,7 +174,7 @@ class MetaInformation
$additionalInfo = (!empty($pageRecord['_additional_info']) ? $pageRecord['_additional_info'] : ''); $additionalInfo = (!empty($pageRecord['_additional_info']) ? $pageRecord['_additional_info'] : '');
// Add icon with context menu, etc: // Add icon with context menu, etc:
// If there IS a real page // If there IS a real page
if (is_array($pageRecord) && $pageRecord['uid']) { if (is_array($pageRecord) && !empty($pageRecord['uid'])) {
$toolTip = BackendUtility::getRecordToolTip($pageRecord, 'pages'); $toolTip = BackendUtility::getRecordToolTip($pageRecord, 'pages');
$iconImg = '<span ' . $toolTip . '>' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>'; $iconImg = '<span ' . $toolTip . '>' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>';
// Make Icon: // Make Icon:
...@@ -185,7 +185,7 @@ class MetaInformation ...@@ -185,7 +185,7 @@ class MetaInformation
// If the module is about a FAL resource // If the module is about a FAL resource
try { try {
$resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']); $resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
$fileMountTitle = $resourceObject->getStorage()->getFileMounts()[$resourceObject->getIdentifier()]['title']; $fileMountTitle = $resourceObject->getStorage()->getFileMounts()[$resourceObject->getIdentifier()]['title'] ?? '';
$title = $fileMountTitle ?: $resourceObject->getName(); $title = $fileMountTitle ?: $resourceObject->getName();
// If this is a folder but not in within file mount boundaries this is the root folder // If this is a folder but not in within file mount boundaries this is the root folder
if ($resourceObject instanceof FolderInterface && !$resourceObject->getStorage()->isWithinFileMountBoundaries($resourceObject)) { if ($resourceObject instanceof FolderInterface && !$resourceObject->getStorage()->isWithinFileMountBoundaries($resourceObject)) {
......
...@@ -256,7 +256,7 @@ function jumpToUrl(URL) { ...@@ -256,7 +256,7 @@ function jumpToUrl(URL) {
$this->scriptID = ltrim(GeneralUtility::_GET('route'), '/'); $this->scriptID = ltrim(GeneralUtility::_GET('route'), '/');
$this->bodyTagId = preg_replace('/[^A-Za-z0-9-]/', '-', $this->scriptID); $this->bodyTagId = preg_replace('/[^A-Za-z0-9-]/', '-', $this->scriptID);
// Individual configuration per script? If so, make a recursive merge of the arrays: // Individual configuration per script? If so, make a recursive merge of the arrays:
if (is_array($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID])) { if (is_array($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID] ?? false)) {
// Make copy // Make copy
$ovr = $GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID]; $ovr = $GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID];
// merge styles. // merge styles.
...@@ -265,16 +265,16 @@ function jumpToUrl(URL) { ...@@ -265,16 +265,16 @@ function jumpToUrl(URL) {
unset($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID]); unset($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID]);
} }
// Main Stylesheets: // Main Stylesheets:
if ($GLOBALS['TBE_STYLES']['stylesheet']) { if (!empty($GLOBALS['TBE_STYLES']['stylesheet'])) {
$this->styleSheetFile = $GLOBALS['TBE_STYLES']['stylesheet']; $this->styleSheetFile = $GLOBALS['TBE_STYLES']['stylesheet'];
} }
if ($GLOBALS['TBE_STYLES']['stylesheet2']) { if (!empty($GLOBALS['TBE_STYLES']['stylesheet2'])) {
$this->styleSheetFile2 = $GLOBALS['TBE_STYLES']['stylesheet2']; $this->styleSheetFile2 = $GLOBALS['TBE_STYLES']['stylesheet2'];
} }
if ($GLOBALS['TBE_STYLES']['styleSheetFile_post']) { if (!empty($GLOBALS['TBE_STYLES']['styleSheetFile_post'])) {
$this->styleSheetFile_post = $GLOBALS['TBE_STYLES']['styleSheetFile_post']; $this->styleSheetFile_post = $GLOBALS['TBE_STYLES']['styleSheetFile_post'];
} }
if ($GLOBALS['TBE_STYLES']['inDocStyles_TBEstyle']) { if (!empty($GLOBALS['TBE_STYLES']['inDocStyles_TBEstyle'])) {
$this->inDocStylesArray['TBEstyle'] = $GLOBALS['TBE_STYLES']['inDocStyles_TBEstyle']; $this->inDocStylesArray['TBEstyle'] = $GLOBALS['TBE_STYLES']['inDocStyles_TBEstyle'];
} }
// include all stylesheets // include all stylesheets
......
...@@ -603,7 +603,7 @@ abstract class AbstractTreeView ...@@ -603,7 +603,7 @@ abstract class AbstractTreeView
*/ */
public function expandNext($id) public function expandNext($id)
{ {
return $this->stored[$this->bank][$id] || $this->expandAll ? 1 : 0; return !empty($this->stored[$this->bank][$id]) || $this->expandAll ? 1 : 0;
} }
/** /**
......
...@@ -236,7 +236,7 @@ class FolderTreeView extends AbstractTreeView ...@@ -236,7 +236,7 @@ class FolderTreeView extends AbstractTreeView
} }
/** /**
* Returns the title for the input record. If blank, a "no title" labele (localized) will be returned. * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
* '_title' is used for setting an alternative title for folders. * '_title' is used for setting an alternative title for folders.
* *
* @param array $row The input row array (where the key "_title" is used for the title) * @param array $row The input row array (where the key "_title" is used for the title)
...@@ -245,7 +245,7 @@ class FolderTreeView extends AbstractTreeView ...@@ -245,7 +245,7 @@ class FolderTreeView extends AbstractTreeView
*/ */
public function getTitleStr($row, $titleLen = 30) public function getTitleStr($row, $titleLen = 30)
{ {
return $row['_title'] ?: parent::getTitleStr($row, $titleLen); return $row['_title'] ?? parent::getTitleStr($row, $titleLen);
} }
/** /**
...@@ -492,7 +492,7 @@ class FolderTreeView extends AbstractTreeView ...@@ -492,7 +492,7 @@ class FolderTreeView extends AbstractTreeView
foreach ($treeItems as $treeItem) { foreach ($treeItems as $treeItem) {
/** @var $folderObject Folder */ /** @var $folderObject Folder */
$folderObject = $treeItem['row']['folder']; $folderObject = $treeItem['row']['folder'];
$classAttr = $treeItem['row']['_CSSCLASS']; $classAttr = $treeItem['row']['_CSSCLASS'] ?? '';
$folderIdentifier = $folderObject->getCombinedIdentifier(); $folderIdentifier = $folderObject->getCombinedIdentifier();
// this is set if the AJAX request has just opened this folder (via the PM command) // this is set if the AJAX request has just opened this folder (via the PM command)
$isExpandedFolderIdentifier = $expandedFolderHash == GeneralUtility::md5int($folderIdentifier); $isExpandedFolderIdentifier = $expandedFolderHash == GeneralUtility::md5int($folderIdentifier);
...@@ -500,27 +500,27 @@ class FolderTreeView extends AbstractTreeView ...@@ -500,27 +500,27 @@ class FolderTreeView extends AbstractTreeView
$itemHTML = ''; $itemHTML = '';
// If this item is the start of a new level, // If this item is the start of a new level,
// then a new level <ul> is needed, but not in ajax mode // then a new level <ul> is needed, but not in ajax mode
if ($treeItem['isFirst'] && !$doCollapse && !($doExpand && $isExpandedFolderIdentifier)) { if (!empty($treeItem['isFirst']) && !$doCollapse && !($doExpand && $isExpandedFolderIdentifier)) {
$itemHTML = '<ul class="list-tree">'; $itemHTML = '<ul class="list-tree">';
} }
// Add CSS classes to the list item // Add CSS classes to the list item
if ($treeItem['hasSub']) { if (!empty($treeItem['hasSub'])) {
$classAttr .= ' list-tree-control-open'; $classAttr .= ' list-tree-control-open';
} }
$itemHTML .= ' $itemHTML .= '
<li id="' . $idAttr . '" ' . ($classAttr ? ' class="' . trim($classAttr) . '"' : '') . '><span class="list-tree-group">' . $treeItem['HTML'] . $this->wrapTitle($this->getTitleStr($treeItem['row'], $titleLength), $folderObject, $treeItem['bank']) . '</span>'; <li id="' . $idAttr . '" ' . ($classAttr ? ' class="' . trim($classAttr) . '"' : '') . '><span class="list-tree-group">' . $treeItem['HTML'] . $this->wrapTitle($this->getTitleStr($treeItem['row'], $titleLength), $folderObject, $treeItem['bank']) . '</span>';
if (!$treeItem['hasSub']) { if (empty($treeItem['hasSub'])) {
$itemHTML .= '</li>'; $itemHTML .= '</li>';
} }
// We have to remember if this is the last one // We have to remember if this is the last one
// on level X so the last child on level X+1 closes the <ul>-tag // on level X so the last child on level X+1 closes the <ul>-tag
if ($treeItem['isLast'] && !($doExpand && $isExpandedFolderIdentifier)) { if (!empty($treeItem['isLast']) && !($doExpand && $isExpandedFolderIdentifier)) {
$closeDepth[$treeItem['invertedDepth']] = 1; $closeDepth[$treeItem['invertedDepth']] = 1;
} }
// If this is the last one and does not have subitems, we need to close // If this is the last one and does not have subitems, we need to close
// the tree as long as the upper levels have last items too // the tree as long as the upper levels have last items too
if ($treeItem['isLast'] && !$treeItem['hasSub'] && !$doCollapse && !($doExpand && $isExpandedFolderIdentifier)) { if (!empty($treeItem['isLast']) && empty($treeItem['hasSub']) && !$doCollapse && !($doExpand && $isExpandedFolderIdentifier)) {
for ($i = $treeItem['invertedDepth']; $closeDepth[$i] == 1; $i++) { for ($i = $treeItem['invertedDepth']; !empty($closeDepth[$i]); $i++) {
$closeDepth[$i] = 0; $closeDepth[$i] = 0;
$itemHTML .= '</ul></li>'; $itemHTML .= '</ul></li>';
} }
...@@ -670,9 +670,9 @@ class FolderTreeView extends AbstractTreeView ...@@ -670,9 +670,9 @@ class FolderTreeView extends AbstractTreeView
} }
} }
// Take the first three parameters // Take the first three parameters
list($mountKey, $doExpand, $folderIdentifier) = explode('_', $PM, 3); list($mountKey, $doExpand, $folderIdentifier) = array_pad(explode('_', $PM, 3), 3, null);
// In case the folder identifier contains "_", we just need to get the fourth/last parameter // In case the folder identifier contains "_", we just need to get the fourth/last parameter
list($folderIdentifier, $treeName) = GeneralUtility::revExplode('_', $folderIdentifier, 2); list($folderIdentifier, $treeName) = array_pad(GeneralUtility::revExplode('_', $folderIdentifier, 2), 2, null);
return [ return [
$mountKey, $mountKey,
$doExpand, $doExpand,
......
...@@ -272,7 +272,7 @@ class LanguageService ...@@ -272,7 +272,7 @@ class LanguageService
if (is_array($localLanguage) && !empty($localLanguage)) { if (is_array($localLanguage) && !empty($localLanguage)) {
// it depends on, whether we should return the result or set it in the global $LOCAL_LANG array // it depends on, whether we should return the result or set it in the global $LOCAL_LANG array
if ($setGlobal) { if ($setGlobal) {
$globalLanguage = (array)$GLOBALS['LOCAL_LANG']; $globalLanguage = (array)($GLOBALS['LOCAL_LANG'] ?? []);
ArrayUtility::mergeRecursiveWithOverrule($globalLanguage, $localLanguage); ArrayUtility::mergeRecursiveWithOverrule($globalLanguage, $localLanguage);
} else { } else {
$globalLanguage = $localLanguage; $globalLanguage = $localLanguage;
......
...@@ -1370,10 +1370,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver ...@@ -1370,10 +1370,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
public function getRole($folderIdentifier) public function getRole($folderIdentifier)
{ {
$name = PathUtility::basename($folderIdentifier); $name = PathUtility::basename($folderIdentifier);
$role = $this->mappingFolderNameToRole[$name]; $role = $this->mappingFolderNameToRole[$name] ?? FolderInterface::ROLE_DEFAULT;
if (empty($role)) {
$role = FolderInterface::ROLE_DEFAULT;
}
return $role; return $role;
} }
......
...@@ -142,7 +142,7 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl ...@@ -142,7 +142,7 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
if ($uid === 0 && $fileIdentifier !== null) { if ($uid === 0 && $fileIdentifier !== null) {
$uid = $this->findBestMatchingStorageByLocalPath($fileIdentifier); $uid = $this->findBestMatchingStorageByLocalPath($fileIdentifier);
} }
if (!$this->storageInstances[$uid]) { if (empty($this->storageInstances[$uid])) {
$storageConfiguration = null; $storageConfiguration = null;
$storageObject = null; $storageObject = null;
list($_, $uid, $recordData, $fileIdentifier) = $this->emitPreProcessStorageSignal($uid, $recordData, $fileIdentifier); list($_, $uid, $recordData, $fileIdentifier) = $this->emitPreProcessStorageSignal($uid, $recordData, $fileIdentifier);
...@@ -374,7 +374,7 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl ...@@ -374,7 +374,7 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
if (!is_numeric($uid)) { if (!is_numeric($uid)) {
throw new \InvalidArgumentException('The UID of file has to be numeric. UID given: "' . $uid . '"', 1300096564); throw new \InvalidArgumentException('The UID of file has to be numeric. UID given: "' . $uid . '"', 1300096564);
} }
if (!$this->fileInstances[$uid]) { if (empty($this->fileInstances[$uid])) {
// Fetches data in case $fileData is empty // Fetches data in case $fileData is empty
if (empty($fileData)) { if (empty($fileData)) {
$fileData = $this->getFileIndexRepository()->findOneByUid($uid); $fileData = $this->getFileIndexRepository()->findOneByUid($uid);
......
...@@ -1570,7 +1570,7 @@ class ResourceStorage implements ResourceStorageInterface ...@@ -1570,7 +1570,7 @@ class ResourceStorage implements ResourceStorageInterface
foreach ($allStorages as $storage) { foreach ($allStorages as $storage) {
// To circumvent the permission check of the folder, we use the factory to create it "manually" instead of directly using $storage->getProcessingFolder() // To circumvent the permission check of the folder, we use the factory to create it "manually" instead of directly using $storage->getProcessingFolder()
// See #66695 for details // See #66695 for details
list($storageUid, $processingFolderIdentifier) = GeneralUtility::trimExplode(':', $storage->getStorageRecord()['processingfolder']); list($storageUid, $processingFolderIdentifier) = array_pad(GeneralUtility::trimExplode(':', $storage->getStorageRecord()['processingfolder']), 2, null);
if (empty($processingFolderIdentifier) || (int)$storageUid !== $this->getUid()) { if (empty($processingFolderIdentifier) || (int)$storageUid !== $this->getUid()) {
continue; continue;
} }
......
...@@ -843,7 +843,7 @@ class ExtensionManagementUtility ...@@ -843,7 +843,7 @@ class ExtensionManagementUtility
// If there is already a main module by this name: // If there is already a main module by this name:
// Adding the submodule to the correct position: // Adding the submodule to the correct position:
if (isset($GLOBALS['TBE_MODULES'][$main]) && $sub) { if (isset($GLOBALS['TBE_MODULES'][$main]) && $sub) {
list($place, $modRef) = GeneralUtility::trimExplode(':', $position, true); list($place, $modRef) = array_pad(GeneralUtility::trimExplode(':', $position, true), 2, null);
$modules = ',' . $GLOBALS['TBE_MODULES'][$main] . ','; $modules = ',' . $GLOBALS['TBE_MODULES'][$main] . ',';
if ($place === null || ($modRef !== null && !GeneralUtility::inList($modules, $modRef))) { if ($place === null || ($modRef !== null && !GeneralUtility::inList($modules, $modRef))) {
$place = 'bottom'; $place = 'bottom';
...@@ -1779,7 +1779,7 @@ tt_content.' . $key . $suffix . ' { ...@@ -1779,7 +1779,7 @@ tt_content.' . $key . $suffix . ' {
global $_EXTKEY; global $_EXTKEY;
// Load each ext_tables.php file of loaded extensions // Load each ext_tables.php file of loaded extensions
foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $_EXTKEY => $extensionInformation) { foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $_EXTKEY => $extensionInformation) {
if ((is_array($extensionInformation) || $extensionInformation instanceof \ArrayAccess) && $extensionInformation['ext_tables.php']) { if ((is_array($extensionInformation) || $extensionInformation instanceof \ArrayAccess) && !empty($extensionInformation['ext_tables.php'])) {
// $_EXTKEY and $_EXTCONF are available in ext_tables.php // $_EXTKEY and $_EXTCONF are available in ext_tables.php
// and are explicitly set in cached file as well // and are explicitly set in cached file as well
$_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] ?? null; $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] ?? null;
......
...@@ -205,7 +205,7 @@ class GeneralUtility ...@@ -205,7 +205,7 @@ class GeneralUtility
*/ */
public static function _POST($var = null) public static function _POST($var = null)
{ {
$value = $var === null ? $_POST : (empty($var) ? null : $_POST[$var]); $value = $var === null ? $_POST : (empty($var) || !isset($_POST[$var]) ? null : $_POST[$var]);
// This is there for backwards-compatibility, in order to avoid NULL // This is there for backwards-compatibility, in order to avoid NULL
if (isset($value) && !is_array($value)) { if (isset($value) && !is_array($value)) {
$value = (string)$value; $value = (string)$value;
...@@ -1664,13 +1664,13 @@ class GeneralUtility ...@@ -1664,13 +1664,13 @@ class GeneralUtility
break; break;
case 'complete': case 'complete':
// If "complete", then it's a value. If the attribute "base64" is set, then decode the value, otherwise just set it. // If "complete", then it's a value. If the attribute "base64" is set, then decode the value, otherwise just set it.
if ($val['attributes']['base64']) { if (!empty($val['attributes']['base64'])) {
$current[$tagName] = base64_decode($val['value']); $current[$tagName] = base64_decode($val['value']);
} else { } else {
// Had to cast it as a string - otherwise it would be evaluate FALSE if tested with isset()!! // Had to cast it as a string - otherwise it would be evaluate FALSE if tested with isset()!!
$current[$tagName] = (string)$val['value']; $current[$tagName] = (string)($val['value'] ?? '');
// Cast type: // Cast type:
switch ((string)$val['attributes']['type']) { switch ((string)($val['attributes']['type'] ?? '')) {
case 'integer': case 'integer':
$current[$tagName] = (int)$current[$tagName]; $current[$tagName] = (int)$current[$tagName];
break; break;
...@@ -2458,7 +2458,7 @@ class GeneralUtility ...@@ -2458,7 +2458,7 @@ class GeneralUtility
if (!$mode) { if (!$mode) {
// If use of .htaccess rule is not configured, // If use of .htaccess rule is not configured,
// we use the default query-string method // we use the default query-string method
if ($lookupFile[1]) { if (!empty($lookupFile[1])) {
$separator = '&'; $separator = '&';
} else { } else {
$separator = '?'; $separator = '?';
...@@ -2606,7 +2606,7 @@ class GeneralUtility ...@@ -2606,7 +2606,7 @@ class GeneralUtility
break; break;
case 'REQUEST_URI': case 'REQUEST_URI':
// Typical application of REQUEST_URI is return urls, forms submitting to itself etc. Example: returnUrl='.rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) // Typical application of REQUEST_URI is return urls, forms submitting to itself etc. Example: returnUrl='.rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI'))
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['requestURIvar']) { if (!empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['requestURIvar'])) {
// This is for URL rewriters that store the original URI in a server variable (eg ISAPI_Rewriter for IIS: HTTP_X_REWRITE_URL) // This is for URL rewriters that store the original URI in a server variable (eg ISAPI_Rewriter for IIS: HTTP_X_REWRITE_URL)
list($v, $n) = explode('|', $GLOBALS['TYPO3_CONF_VARS']['SYS']['requestURIvar']); list($v, $n) = explode('|', $GLOBALS['TYPO3_CONF_VARS']['SYS']['requestURIvar']);
$retVal = $GLOBALS[$v][$n]; $retVal = $GLOBALS[$v][$n];
......
...@@ -304,13 +304,13 @@ class PathUtility ...@@ -304,13 +304,13 @@ class PathUtility
$theDirPartsCount--; $theDirPartsCount--;
} }
// "." in path: remove element // "." in path: remove element
if ($theDirParts[$partCount] === '.') { if (($theDirParts[$partCount] ?? '') === '.') {
array_splice($theDirParts, $partCount, 1); array_splice($theDirParts, $partCount, 1);
$partCount--; $partCount--;
$theDirPartsCount--; $theDirPartsCount--;
} }
// ".." in path: // ".." in path:
if ($theDirParts[$partCount] === '..') { if (($theDirParts[$partCount] ?? '') === '..') {
if ($partCount >= 1) { if ($partCount >= 1) {
// Rremove this and previous element // Rremove this and previous element
array_splice($theDirParts, $partCount - 1, 2); array_splice($theDirParts, $partCount - 1, 2);
......
...@@ -86,12 +86,12 @@ class BackendConfigurationManager extends AbstractConfigurationManager ...@@ -86,12 +86,12 @@ class BackendConfigurationManager extends AbstractConfigurationManager
{ {
$setup = $this->getTypoScriptSetup(); $setup = $this->getTypoScriptSetup();
$pluginConfiguration = []; $pluginConfiguration = [];
if (is_array($setup['module.']['tx_' . strtolower($extensionName) . '.'])) { if (is_array($setup['module.']['tx_' . strtolower($extensionName) . '.'] ?? false)) {
$pluginConfiguration = $this->typoScriptService->convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . strtolower($extensionName) . '.']); $pluginConfiguration = $this->typoScriptService->convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . strtolower($extensionName) . '.']);
} }
if ($pluginName !== null) { if ($pluginName !== null) {
$pluginSignature = strtolower($extensionName . '_' . $pluginName); $pluginSignature = strtolower($extensionName . '_' . $pluginName);
if (is_array($setup['module.']['tx_' . $pluginSignature . '.'])) { if (is_array($setup['module.']['tx_' . $pluginSignature . '.'] ?? false)) {
$overruleConfiguration = $this->typoScriptService->convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . $pluginSignature . '.']); $overruleConfiguration = $this->typoScriptService->convertTypoScriptArrayToPlainArray($setup['module.']['tx_' . $pluginSignature . '.']);
ArrayUtility::mergeRecursiveWithOverrule($pluginConfiguration, $overruleConfiguration); ArrayUtility::mergeRecursiveWithOverrule($pluginConfiguration, $overruleConfiguration);
} }
...@@ -112,7 +112,7 @@ class BackendConfigurationManager extends AbstractConfigurationManager ...@@ -112,7 +112,7 @@ class BackendConfigurationManager extends AbstractConfigurationManager
*/ */
protected function getSwitchableControllerActions($extensionName, $pluginName) protected function getSwitchableControllerActions($extensionName, $pluginName)
{ {
$switchableControllerActions = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['modules'][$pluginName]['controllers']; $switchableControllerActions = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['modules'][$pluginName]['controllers'] ?? false;
if (!is_array($switchableControllerActions)) { if (!is_array($switchableControllerActions)) {
$switchableControllerActions = []; $switchableControllerActions = [];
} }
......
...@@ -121,7 +121,7 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura ...@@ -121,7 +121,7 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
switch ($configurationType) { switch ($configurationType) {
case self::CONFIGURATION_TYPE_SETTINGS: case self::CONFIGURATION_TYPE_SETTINGS:
$configuration = $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName); $configuration = $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
return $configuration['settings']; return $configuration['settings'] ?? [];
case self::CONFIGURATION_TYPE_FRAMEWORK: case self::CONFIGURATION_TYPE_FRAMEWORK:
return $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName); return $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
case self::CONFIGURATION_TYPE_FULL_TYPOSCRIPT: case self::CONFIGURATION_TYPE_FULL_TYPOSCRIPT:
......
...@@ -173,7 +173,7 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface ...@@ -173,7 +173,7 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface
$request->setRequestUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')); $request->setRequestUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
$request->setBaseUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')); $request->setBaseUri(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'));
$request->setMethod($this->environmentService->getServerRequestMethod()); $request->setMethod($this->environmentService->getServerRequestMethod());
if (is_string($parameters['format']) && $parameters['format'] !== '') { if (isset($parameters['format']) && is_string($parameters['format']) && $parameters['format'] !== '') {
$request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING)); $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
} else {