Project

General

Profile

Actions

Bug #99648

closed

The method getPageAndRootline in TypoScriptFrontendController can throw the PHP warning : Undefined array key "hidden" in ...

Added by Thomas Hohn over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Start date:
2023-01-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In the TypoScriptFrontendController there is the following code:

 if (!empty($hiddenField) && !$includeHiddenPages) {
                    // Page is "hidden" => 404 (deliberately done in default language, as this cascades to language overlays)
                    $rawPageRecord = $this->sys_page->getPage_noCheck($this->id);
                    $requestedPageIsHidden = (bool)$rawPageRecord[$hiddenField];
                }

If a non-existing id is provided the $rawPageRecord will be the empty array and hence the line
$requestedPageIsHidden

will throw an error the line should instead be
$requestedPageIsHidden = (bool)(isset($rawPageRecord[$hiddenField] ?: false);
Actions

Also available in: Atom PDF