From a2503ae1ef89fc66f6c0e88e953e5e1956552f1c Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Wed, 1 Feb 2023 01:47:59 -0800 Subject: [PATCH] Hopefully fix issue #763 CGI shouldn't be included in that check, as it would make any server running CGI log the user in as the cron user --- src/di.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/di.php b/src/di.php index 01bbaf06f..88e65514f 100644 --- a/src/di.php +++ b/src/di.php @@ -398,7 +398,7 @@ $di['loggedin_client'] = function () use ($di) { * @throws \Box_Exception If the script is running in CLI or CGI mode and there is no cron admin available. */ $di['loggedin_admin'] = function () use ($di) { - if ('cli' === php_sapi_name() || str_starts_with(php_sapi_name(), 'cgi')) { + if ('cli' === php_sapi_name() || !http_response_code()) { return $di['mod_service']('staff')->getCronAdmin(); }