Skip to content

Commit

Permalink
Merge pull request #3510 from bobvandevijver/patch-4
Browse files Browse the repository at this point in the history
Handle incorrect parameters gracefully
  • Loading branch information
bobdenotter authored Dec 22, 2023
2 parents 7b8c7e0 + fc5602f commit 4b4686c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ private function parseParameters(string $paramString): void
$raw = explode('×', preg_replace('/([0-9])(x)([0-9a-z])/i', '\1×\3', $paramString));

$this->parameters = [
'w' => is_numeric($raw[0]) ? (int) $raw[0] : 400,
'h' => is_numeric($raw[1]) ? (int) $raw[1] : 300,
'w' => (isset($raw[0]) && is_numeric($raw[0])) ? (int) $raw[0] : 400,
'h' => (isset($raw[1]) && is_numeric($raw[1])) ? (int) $raw[1] : 300,
'fit' => isset($raw[2]) ? $raw[2] : $this->config->get('general/thumbnails/default_cropping', 'default'),
'location' => 'files',
'q' => (!empty($raw[2]) && 0 <= $raw[2] && $raw[2] <= 100) ? (int) $raw[2] : 80
Expand Down

0 comments on commit 4b4686c

Please sign in to comment.