From: nokonoko Date: Wed, 18 Nov 2020 13:31:59 +0000 (+0100) Subject: durr X-Git-Tag: v1.0~46^2~2 X-Git-Url: https://jfr.im/git/uguu.git/commitdiff_plain/4b7727f772fdf9691abde14375e2bbf98487084a?hp=180e80182f6877e688091580d9ce3cbf3869ebed durr --- diff --git a/static/js/app.js b/static/js/app.js index 0e843e2..d70808b 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -130,6 +130,9 @@ document.addEventListener('DOMContentLoaded', function() { } else if (respStatus === 413) { link.textContent = 'File too big!'; url.appendChild(link); + } else if (respStatus === 415) { + link.textContent = 'File not allowed lol!'; + url.appendChild(link); } else { link.textContent = 'Filetype not allowed or server error!'; url.appendChild(link); diff --git a/static/php/upload.php b/static/php/upload.php index de61b2d..8719076 100644 --- a/static/php/upload.php +++ b/static/php/upload.php @@ -56,12 +56,14 @@ function generateName($file) //Check if mime is blacklisted if (in_array($type_mime, unserialize(CONFIG_BLOCKED_MIME))) { + http_response_code(415); throw new Exception('Filetype not allowed!'); exit(0); } //Check if EXT is blacklisted if (in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))) { + http_response_code(415); throw new Exception('Filetype not allowed!'); exit(0); }