diff options
-rw-r--r-- | http/api-inc.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index 720926f..c75ed2e 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -61,6 +61,10 @@ class ApiPkl { $this->parameters = $this->parse_parameters($parameters); } + protected function is_integer($value) { + return ctype_digit($value) || is_int($value); + } + function ensure_parameters($params) { foreach ($params as $param) { if (!isset($this->parameters[$param])) { @@ -261,7 +265,7 @@ class ApiPklV3 extends ApiPklV2 { } if (isset($this->parameters['boards'])) { $this->check_values($this->parameters, array( - 'boards' => function($r) { return ctype_digit($r); } + 'boards' => function($r) { return $this->is_integer($r); } )); $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); } |