From 6184c4c93bf5fbc48f618f169fb2a3b56d325a0e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 24 Nov 2021 09:57:25 +0000 Subject: [PATCH] Add Eldad's Suggestion --- app/controllers/shared/api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 968fdfc9fd..3e72389b55 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -40,9 +40,7 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e $abuseKeyLabel = $route->getLabel('abuse-key', 'url:{url},ip:{ip}'); $timeLimitArray = []; - if (!is_array($abuseKeyLabel)) { - $abuseKeyLabel = [$abuseKeyLabel]; - } + $abuseKeyLabel = (!is_array($abuseKeyLabel)) ? [$abuseKeyLabel] : $abuseKeyLabel; foreach ($abuseKeyLabel as $abuseKey) { $timeLimit = new TimeLimit($abuseKey, $route->getLabel('abuse-limit', 0), $route->getLabel('abuse-time', 3600), $db);