Skip to content

Commit

Permalink
[BUGFIX] Avoid 500 error for non-admins in page tree
Browse files Browse the repository at this point in the history
This patch prevents throwing and spamming the logs
with 500 server errors.

Resolves: #91145
Releases: master, 9.5
Change-Id: I9385a9c0a2a665cedb1340cc8397740b0bd6255e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64150
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
bmack authored and andreaskienast committed Apr 20, 2020
1 parent 2e17997 commit ba71265
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ protected function pagesToFlatArray(array $page, int $entryPoint, int $depth = 0
if (in_array($pageId, $this->hiddenRecords, true)) {
return [];
}
if ($pageId === 0 && !$backendUser->isAdmin()) {
return [];
}

$stopPageTree = !empty($page['php_tree_stop']) && $depth > 0;
$identifier = $entryPoint . '_' . $pageId;
Expand Down

0 comments on commit ba71265

Please sign in to comment.