mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: obfuscate email in contact links, raise rate limits, make Libre toggleable
- about.php: use EmailObfuscator::email() for contact email link text instead of htmlspecialchars - SearchController: raise rate limit from 30 to 300 req/min - request-access.php: raise rate limit from 3 to 30 req/10min - partage/index.php: raise rate limit from 5 to 50 req/10min - contenus.php: make Libre option toggleable (remove disabled class), move to top of Degré d'ouverture, remove temporary note about next academic year
This commit is contained in:
@@ -471,7 +471,7 @@ function handleShareLinkSubmission(string $slug): void
|
||||
// 5 submissions per IP per 10 minutes, keyed per share link.
|
||||
$rateLimitCacheDir = STORAGE_ROOT . '/cache/rate_limit';
|
||||
$shareRateLimitId = 'share_' . $slug . '_' . ($_SERVER['REMOTE_ADDR'] ?? 'unknown');
|
||||
$rateLimit = new RateLimit(5, 600, $rateLimitCacheDir);
|
||||
$rateLimit = new RateLimit(50, 600, $rateLimitCacheDir);
|
||||
|
||||
if (!$rateLimit->checkKey($shareRateLimitId)) {
|
||||
$_SESSION['_flash_error'] = 'Trop de tentatives. Veuillez réessayer plus tard.';
|
||||
|
||||
@@ -88,7 +88,7 @@ if ($accessTypeId !== 2) {
|
||||
|
||||
// Rate limiting: max 3 requests per 10 minutes per IP
|
||||
$rateLimitKey = 'access_request_' . ($_SERVER['REMOTE_ADDR'] ?? 'unknown');
|
||||
if (!(new RateLimit(3, 600))->checkKey($rateLimitKey)) {
|
||||
if (!(new RateLimit(30, 600))->checkKey($rateLimitKey)) {
|
||||
http_response_code(429);
|
||||
echo json_encode(['success' => false, 'message' => 'Trop de requêtes. Veuillez réessayer dans quelques minutes.']);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user