Skip to content

Commit 6fa9bdc

Browse files
committed
replace bad isset, is_null with is_array
1 parent 4404f5e commit 6fa9bdc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

resources/lib/UnityHTTPD.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,8 @@ public static function getPostData(string $key): mixed
238238
/* returns null if not found and not $throw_if_not_found */
239239
public static function getQueryParameter(string $key, bool $throw_if_not_found = true): mixed
240240
{
241-
if (isset($_GET)) {
242-
self::badRequest('$_GET is unset');
243-
}
244-
if ($_GET === null) {
245-
self::badRequest('$_GET is null');
241+
if (!is_array($_GET)) {
242+
throw new RuntimeException('$_GET is not an array!');
246243
}
247244
if (!array_key_exists($key, $_GET)) {
248245
if ($throw_if_not_found) {

0 commit comments

Comments
 (0)