diff options
Diffstat (limited to 'http/api-inc.php')
-rw-r--r-- | http/api-inc.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index 2606df7..720926f 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -38,9 +38,9 @@ function run($parameters) { $version = isset($parameters['version']) ? $parameters['version'] : '_default'; $apiClass = isset($versionClasses[$version]) ? $versionClasses[$version] : $versionClasses['_default']; $api = new $apiClass($parameters); - if ($parameters['tournament_rank'] == ApiPkl::RANK_KMP) { + if (isset($parameters['tournament_rank']) && $parameters['tournament_rank'] == ApiPkl::RANK_KMP) { $result = $api->calculate_kmp_points(); - } else if ($parameters['tournament_rank'] == ApiPkl::RANK_BNET) { + } else if (isset($parameters['tournament_rank']) && $parameters['tournament_rank'] == ApiPkl::RANK_BNET) { $result = $api->calculate_bridgenet_points(); } else { $result = $api->calculate_points(); @@ -117,7 +117,7 @@ class ApiPkl { if ($return['type'] == 3 || $return['type'] > 4) { throw new ParametersException('Parameter: type has incorrect value (' . $return['type'] . ')'); } - if ($return['type'] != 2 && $this->parameters['tournament_rank'] == ApiPkl::RANK_KMP) { + if ($return['type'] != 2 && isset($this->parameters['tournament_rank']) && $this->parameters['tournament_rank'] == ApiPkl::RANK_KMP) { throw new ParametersException('Parameter: type has incorrect value (' . $return['type'] . ') for KMP tournament'); } if (isset($this->parameters['boards'])) { |