]> jfr.im git - uguu.git/commitdiff
durr
authornokonoko <redacted>
Wed, 18 Nov 2020 13:31:59 +0000 (14:31 +0100)
committernokonoko <redacted>
Wed, 18 Nov 2020 13:31:59 +0000 (14:31 +0100)
static/js/app.js
static/php/upload.php

index 0e843e2c53ee27e155bfa127a2214b15e046dd55..d70808b370d2991355393ac6efe2c9688381f3cf 100644 (file)
@@ -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);
index de61b2dc51494cd1bd3f3ce968fb26e6a405e6ca..87190763be82e46bf89f41cc7cff3b7e0c1d2d9e 100644 (file)
@@ -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);
         }