Fixes app root redirection on ratelimiting

main
Yasen Pramatarov 2025-02-23 15:21:40 +02:00
parent 34779bb891
commit 035681ab28
1 changed files with 1 additions and 0 deletions

View File

@ -11,6 +11,7 @@ require_once __DIR__ . '/../classes/ratelimiter.php';
* @return bool True if request is allowed, false if rate limited
*/
function checkRateLimit($database, $endpoint, $userId = null) {
global $app_root;
$isTest = defined('PHPUNIT_RUNNING');
$rateLimiter = new RateLimiter($database);
$ipAddress = $_SERVER['REMOTE_ADDR'];