From 81c5cfa4788412b431f0f6679dcbbabee0ae2756 Mon Sep 17 00:00:00 2001 From: lionel Date: Tue, 19 Jan 2021 18:39:59 +0100 Subject: [PATCH] Check mbstring --- js/script.js | 1 + upload.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/js/script.js b/js/script.js index 1b48aa6..1722521 100644 --- a/js/script.js +++ b/js/script.js @@ -243,6 +243,7 @@ function downloadFile(event) { function error(data, statut, error) { lock = 0; + console.log(data.status + " " + data.statusText); console.log(data); //$('body').html(data['status'] + ' ' + error + '
' + data['responseText']); }; diff --git a/upload.php b/upload.php index ee8c3a9..16431ed 100644 --- a/upload.php +++ b/upload.php @@ -18,6 +18,12 @@ $file = $_FILES["file"]; $name = basename($file["name"]); + +if (! extension_loaded('mbstring')) { + header("HTTP/1.1 400 Bad encode"); + exit(); +} + if(! mb_check_encoding($name)) { header("HTTP/1.1 400 Bad encode"); exit();