fix: reject zero-dimension viewport values

This commit is contained in:
2026-04-21 12:04:05 +02:00
parent 8590465c6a
commit e7924f462e

View File

@@ -41,7 +41,7 @@ switch ($url[0]) {
exit;
}
$vpParts = array_map('intval', explode('x', $viewport));
if ($vpParts[0] > 3840 || $vpParts[1] > 2160) {
if ($vpParts[0] < 1 || $vpParts[1] < 1 || $vpParts[0] > 3840 || $vpParts[1] > 2160) {
header('HTTP/1.0 400 Bad Request');
echo 'Viewport exceeds maximum (3840x2160)';
exit;