From 137ef691e71c9beeb16cd4ab0520a8a474b15e53 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Mon, 4 Sep 2023 13:19:04 +0200 Subject: [PATCH] Remove not needed sanitize for double parameter It happens already in sanitizeRequestData() function of AbstractController --- Classes/Controller/NavigationController.php | 15 +++++++-------- Classes/Controller/PageViewController.php | 6 +++--- Classes/Controller/TableOfContentsController.php | 1 - 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Classes/Controller/NavigationController.php b/Classes/Controller/NavigationController.php index cc9e74fcea..7822730dd4 100644 --- a/Classes/Controller/NavigationController.php +++ b/Classes/Controller/NavigationController.php @@ -58,15 +58,14 @@ public function mainAction() if ($this->isDocMissing()) { // Quit without doing anything if required variables are not set. return ''; + } + + // Set default values if not set. + if ($this->document->getDoc()->numPages > 0) { + $this->setPage(); } else { - // Set default values if not set. - if ($this->document->getDoc()->numPages > 0) { - $this->setPage(); - $this->requestData['double'] = MathUtility::forceIntegerInRange($this->requestData['double'], 0, 1, 0); - } else { - $this->requestData['page'] = 0; - $this->requestData['double'] = 0; - } + $this->requestData['page'] = 0; + $this->requestData['double'] = 0; } // Steps for X pages backward / forward. Double page view uses double steps. diff --git a/Classes/Controller/PageViewController.php b/Classes/Controller/PageViewController.php index 85f75faa19..388e6289ea 100644 --- a/Classes/Controller/PageViewController.php +++ b/Classes/Controller/PageViewController.php @@ -71,10 +71,10 @@ public function mainAction() if ($this->isDocMissingOrEmpty()) { // Quit without doing anything if required variables are not set. return ''; - } else { - $this->setPage(); - $this->requestData['double'] = MathUtility::forceIntegerInRange($this->requestData['double'], 0, 1, 0); } + + $this->setPage(); + // Get image data. $this->images[0] = $this->getImage($this->requestData['page']); $this->fulltexts[0] = $this->getFulltext($this->requestData['page']); diff --git a/Classes/Controller/TableOfContentsController.php b/Classes/Controller/TableOfContentsController.php index d90b5b8b2c..6893d422cf 100644 --- a/Classes/Controller/TableOfContentsController.php +++ b/Classes/Controller/TableOfContentsController.php @@ -63,7 +63,6 @@ public function mainAction() */ private function makeMenuArray() { - $this->requestData['double'] = MathUtility::forceIntegerInRange($this->requestData['double'], 0, 1, 0); $menuArray = []; // Does the document have physical elements or is it an external file? if (