From 0be8e835ef37f419a3af82f3ed1c82456dfaf48c Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 27 Oct 2022 17:15:48 +0100 Subject: [PATCH] avoid crashing in cron_upload if API key isn't set, fixes #881 --- ext/cron_uploader/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index f52bb4c9..df0cb729 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -207,7 +207,7 @@ class CronUploader extends Extension { global $user_config; - $user_api_key = $user_config->get_string(UserConfig::API_KEY); + $user_api_key = $user_config->get_string(UserConfig::API_KEY, "API_KEY"); return make_http(make_link("/cron_upload/run", "api_key=".urlencode($user_api_key))); } @@ -328,7 +328,7 @@ class CronUploader extends Extension $this->set_headers(); if (!$config->get_bool(UserConfig::ENABLE_API_KEYS)) { - throw new SCoreException("User API keys are note enabled. Please enable them for the cron upload functionality to work."); + throw new SCoreException("User API keys are not enabled. Please enable them for the cron upload functionality to work."); } if ($user->is_anonymous()) {