Skip to content

Commit

Permalink
[BUGFIX] Prevent undefined array key error in StoragePermissionsAspect
Browse files Browse the repository at this point in the history
For not yet migrated filemount records, the
StoragePermissionsAspect previously triggered
an undefined array key since the new field "identifier"
(see #97922) might be empty or at least does not
contain the combined identifier with the ":" sign.

Resolves: #98300
Related: #97922
Releases: main
Change-Id: I17671f6ab785983ed77f3990ec5c353e6d099bc2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75664
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Jochen <rothjochen@gmail.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Sep 8, 2022
1 parent d5deccc commit f71c9f8
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -62,6 +62,10 @@ public function addUserPermissionsToStorage(AfterResourceStorageInitializationEv
private function addFileMountsToStorage(ResourceStorage $storage)
{
foreach ($GLOBALS['BE_USER']->getFileMountRecords() as $fileMountRow) {
if (!str_contains($fileMountRow['identifier'], ':')) {
// Skip record since the file mount identifier is invalid
continue;
}
[$base, $path] = GeneralUtility::trimExplode(':', $fileMountRow['identifier'], false, 2);
if ((int)$base === (int)$storage->getUid()) {
try {
Expand Down

0 comments on commit f71c9f8

Please sign in to comment.