|
@@ -17,16 +17,9 @@ class Security
|
17
|
17
|
* Makes sure a number ID is valid,
|
18
|
18
|
* e.g., a page ID requested by GET.
|
19
|
19
|
*/
|
20
|
|
- public function checkInt($ID)
|
21
|
|
- #public function checkInt(int|array $ID) # Union types need PHP 8 - unbelievable!
|
|
20
|
+ public function checkInt(...$IDs)
|
22
|
21
|
{
|
23
|
|
- # Cast single ID to array
|
24
|
|
- if (!is_array($ID)) {
|
25
|
|
- $ID = [$ID];
|
26
|
|
- }
|
27
|
|
-
|
28
|
|
- # Check each ID supplied
|
29
|
|
- foreach ($ID as $ID) {
|
|
22
|
+ foreach ($IDs as $ID) {
|
30
|
23
|
if (!ID || !is_int($ID) || $ID < 1) {
|
31
|
24
|
error(400);
|
32
|
25
|
}
|