Fix some validation errors

This commit is contained in:
Alex Cabal 2023-09-01 12:42:25 -05:00
parent fcde084b2c
commit b919a7e829
2 changed files with 11 additions and 5 deletions

View file

@ -22,7 +22,7 @@ class HttpInput{
}
public static function RequestType(): int{
return preg_match('/\btext\/html\b/ius', $_SERVER['HTTP_ACCEPT']) ? WEB : REST;
return preg_match('/\btext\/html\b/ius', $_SERVER['HTTP_ACCEPT'] ?? '') ? WEB : REST;
}
public static function Str(string $type, string $variable, bool $allowEmptyString = true, string $default = null): ?string{