Skip to content

Commit

Permalink
Remove not needed sanitize for double parameter
Browse files Browse the repository at this point in the history
It happens already in sanitizeRequestData() function of AbstractController
  • Loading branch information
beatrycze-volk committed Sep 4, 2023
1 parent 109c485 commit 137ef69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
15 changes: 7 additions & 8 deletions Classes/Controller/NavigationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions Classes/Controller/PageViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
1 change: 0 additions & 1 deletion Classes/Controller/TableOfContentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 137ef69

Please sign in to comment.