From a09f13de712dac9deb05f4b0bb9254f97fe84d43 Mon Sep 17 00:00:00 2001 From: sorcier Date: Mon, 2 Nov 2026 13:35:43 +0100 Subject: [PATCH] Fix: allow selecting .tar.gz archives in macOS Finder by broadening input accept attribute and adding client-side validation --- public/assets/app.js | 7 +++++++ public/index.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/assets/app.js b/public/assets/app.js index 04766fe..f5f29f6 100644 --- a/public/assets/app.js +++ b/public/assets/app.js @@ -4584,6 +4584,13 @@ async function handleBackupUpload(input) { const file = input?.files?.[0]; if (!file) return; + const lowerName = file.name.toLowerCase(); + if (!lowerName.endsWith('.tar.gz') && !lowerName.endsWith('.tgz')) { + showToast("Format de fichier non supporté. Veuillez sélectionner une archive de sauvegarde .tar.gz ou .tgz", 'error'); + input.value = ''; + return; + } + const ok = confirm(`⚠️ RESTAURATION DISASTER RECOVERY VIA FICHIER TÉLÉVERSÉ ⚠️\n\nFichier sélectionné : ${file.name} (${(file.size / (1024 * 1024)).toFixed(2)} Mo)\n\nVoulez-vous restaurer immédiatement le système NexusPBX avec cette archive ?\nToutes les données actuelles seront remplacées.`); if (!ok) { input.value = ''; diff --git a/public/index.php b/public/index.php index 85e3378..5bbe7f2 100644 --- a/public/index.php +++ b/public/index.php @@ -1533,7 +1533,7 @@ $currentUser = Auth::getUsername();
- +