diff options
author | emkael <emkael@tlen.pl> | 2020-05-14 01:35:33 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-05-14 01:35:33 +0200 |
commit | 316201fc806236d1ac1115f97caefcd514adc528 (patch) | |
tree | dda26f8795c541136de19181e8b7cf5c9a9d077e | |
parent | 1e0b0b0e93ad6efe1d9bfef2e52665f73b17df38 (diff) |
Do not skip type/board number check for B***eNET even if manual overrides are provided
-rw-r--r-- | http/api-inc.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index 1364195..7780e64 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -250,18 +250,18 @@ class ApiPklV2 extends ApiPklV1 { class ApiPklV3 extends ApiPklV2 { function check_parameters() { - if (!isset($this->parameters['manual']) || !isset($this->parameters['manual']['min_points']) || !isset($this->parameters['manual']['tournament_weight'])) { - $this->ensure_parameters(array('tournament_rank')); - if ($this->parameters['tournament_rank'] == ApiPkl::RANK_BNET) { - $this->ensure_parameters(array('boards')); - } - if (isset($this->parameters['boards'])) { - $this->check_values($this->parameters, array( - 'boards' => function($r) { return ctype_digit($r); } - )); - $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); + if (isset($this->parameters['tournament_rank']) && $this->parameters['tournament_rank'] == ApiPkl::RANK_BNET) { + $this->ensure_parameters(array('boards', 'type')); + if ($this->parameters['type'] == 4) { + throw new ParametersException('Parameter: type has incorrect value (' . $this->parameters['type'] . ') for BridgeNET tournament'); } } + if (isset($this->parameters['boards'])) { + $this->check_values($this->parameters, array( + 'boards' => function($r) { return ctype_digit($r); } + )); + $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39)); + } return parent::check_parameters(); } |