Skip to content

Commit

Permalink
Check if output value is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdekruijk committed Oct 4, 2018
1 parent 2438805 commit b6d5b49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ResizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ private function resize($template, $original, $target)

# Change type to force output format if used in template
if (isset($template['output'])) {
$type = 'image/' . $template['output'];
if (in_array($template['output'], ['jpg', 'jpeg', 'png', 'gif'])) {
$type = 'image/' . $template['output'];
} else {
self::error('Invalid output ' . $template['output']);
}
}

# Save the resized image in a variable
Expand Down

0 comments on commit b6d5b49

Please sign in to comment.