aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/api.php')
-rw-r--r--engine/lib/api.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/engine/lib/api.php b/engine/lib/api.php
index 7e685cdd6..3f97b0c8c 100644
--- a/engine/lib/api.php
+++ b/engine/lib/api.php
@@ -198,6 +198,9 @@
$site = (int)$site;
$token = sanitise_string($token);
+ if (!$site) throw new ConfigurationException("No site ID has been specified.");
+ if (!$token) throw new APIException("User token not specified.");
+
$time = time();
$user = get_data_row("SELECT * from {$CONFIG->dbprefix}users_apisessions where token='$token' and site_id=$site and expires>$time");