Skip to content

Commit

Permalink
[BUGFIX] Adjust setting of the default page (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk authored and sebastian-meyer committed Jun 3, 2024
1 parent 4a9f675 commit 037b5d3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,9 @@ protected function setDefaultPage(): void
{
// Set default values if not set.
// $this->requestData['page'] may be integer or string (physical structure @ID)
if (
(int) $this->requestData['page'] > 0
|| empty($this->requestData['page'])
) {
if (empty($this->requestData['page'])) {
$this->requestData['page'] = 1;
} elseif ((int) $this->requestData['page'] > 0) {
$this->requestData['page'] = MathUtility::forceIntegerInRange((int) $this->requestData['page'], 1, $this->document->getCurrentDocument()->numPages, 1);
} else {
$this->requestData['page'] = array_search($this->requestData['page'], $this->document->getCurrentDocument()->physicalStructure);
Expand Down

0 comments on commit 037b5d3

Please sign in to comment.