Commit 37f059e1 authored by Jochen Roth's avatar Jochen Roth Committed by Christian Kuhn
Browse files

[BUGFIX] Fix array access for user without read permissions in PHP8

Given you have a user which has no access to the current page
or no page at all, a "access array offset on value of type"
is thrown in PHP8.

This has been fixed by adding a fallback in case the
array key does not exist which then throws the expected

Resolves: #96026
Releases: master, 11.5
Change-Id: I335a74fb6c2566d7a3e65632977dbc2740249414

Tested-by: core-ci's avatarcore-ci <>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <>
Tested-by: Stefan Bürk's avatarStefan Bürk <>
Tested-by: Christian Kuhn's avatarChristian Kuhn <>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <>
parent b60cf59f
......@@ -185,7 +185,7 @@ class RouteDispatcher extends Dispatcher
// Check if page has been deleted
$deleteField = $GLOBALS['TCA']['pages']['ctrl']['delete'];
$pageInfo = BackendUtility::getRecord('pages', $id, $deleteField, $permClause ? ' AND ' . $permClause : '', false);
if (!$pageInfo[$deleteField]) {
if (!($pageInfo[$deleteField] ?? false)) {
throw new \RuntimeException('You don\'t have access to this page', 1289917924);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment