Refactor file upload restrictions to limit accepted formats to JPG and PNG, and update maximum file size to 20MB

This commit is contained in:
Fabian Schieder 2026-01-25 23:07:07 +01:00
parent 3a17a957cb
commit 8a7d726fd9
2 changed files with 1 additions and 2 deletions

View File

@ -93,7 +93,7 @@ include 'header.php';
<div class="auth__field"> <div class="auth__field">
<label for="file">Profilbild auswählen</label> <label for="file">Profilbild auswählen</label>
<input type="file" name="uploadFile" id="file" accept="image/*" required> <input type="file" name="uploadFile" id="file" accept="image/*" required>
<p class="auth__hint">Erlaubt: JPG/PNG/WebP. Maximalgröße je nach Server.</p> <p class="auth__hint">Erlaubt: JPG/PNG. max. 20MB.</p>
</div> </div>
<div class="auth__actions"> <div class="auth__actions">

View File

@ -51,7 +51,6 @@ if ($tmp === '' || !is_uploaded_file($tmp))
$allowedMimeToExt = [ $allowedMimeToExt = [
'image/jpeg' => 'jpg', 'image/jpeg' => 'jpg',
'image/png' => 'png', 'image/png' => 'png',
'image/webp' => 'webp'
]; ];
$finfo = new finfo(FILEINFO_MIME_TYPE); $finfo = new finfo(FILEINFO_MIME_TYPE);