Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,19 @@ public static function generate(Event $event)
break;
}
}
$builder = new UrlBuilder($base, $key, $salt);

if(preg_match('/^[0-9]+$/', $width)){
$width = (int) trim($width);
} else {
throw new \Exception("Width does not look like valid");
}
if(preg_match('/^[0-9]+$/', $height)){
$height = (int) trim($height);
} else {
throw new \Exception("Height does not look like valid");
}

$builder = new UrlBuilder($base, $key, $salt);
$url = new Url($builder, $source, $width, $height);
if ($advanced) {
$url->useAdvancedMode();
Expand Down