Rétablir la compatibilité avec PHP 8.2

This commit is contained in:
Alexandre NOEL 2026-09-03 22:43:59 +02:00
commit 63224d8b06
12 changed files with 16 additions and 16 deletions

View file

@ -144,7 +144,7 @@ final class GrantsController
header('Location: /admin/grants?year=' . $year . '&error=document');
return;
}
$mime = new finfo(FILEINFO_MIME_TYPE)->file($f['tmp_name']) ?: 'application/octet-stream';
$mime = (new finfo(FILEINFO_MIME_TYPE))->file($f['tmp_name']) ?: 'application/octet-stream';
$allowed = ['application/pdf' => 'pdf', 'application/vnd.oasis.opendocument.text' => 'odt'];
if (!isset($allowed[$mime])) {
header('Location: /admin/grants?year=' . $year . '&error=format');