Update: 2026-07-22 00:52:19

This commit is contained in:
Hamza-Ayed
2026-07-22 00:52:20 +03:00
parent 521d76c4cf
commit bbcefd20cf
+4
View File
@@ -30,6 +30,10 @@ class RateLimiter
// $type: login | otp | api | ride | upload
public function check(string $identifier, string $type = 'api'): bool
{
if (getenv('DISABLE_RATE_LIMITER') === 'true' || ($_ENV['DISABLE_RATE_LIMITER'] ?? '') === 'true') {
return true;
}
if (!$this->redis) {
// HIGH-01 FIX: fallback مع ملف بدلاً من تمرير كل الطلبات
return $this->fileBasedCheck($identifier, $type);