]> git.p6c8.net - jirafeau/pcanterino.git/commitdiff
Keep the size error when the extension is also forbidden
authorTehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com>
Fri, 16 Oct 2026 10:42:58 +0000 (12:42 +0200)
committerTehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com>
Fri, 16 Oct 2026 10:51:25 +0000 (12:51 +0200)
lib/functions.js.php

index 9307eda582a2fd8e899563cb2331e42797a39a3b..efa82e5a3ff52dccbc89804b02322fa297d50082 100644 (file)
@@ -360,7 +360,12 @@ function control_selected_file_extension(disallowed_extensions, error_str)
     f_ext = f_name.includes('.') ? f_name.split('.').pop().toLowerCase() : '';
     if (disallowed_extensions.includes(f_ext))
     {
-        pop_failure(error_str);
+        // control_selected_file_size runs first: keep its error, if any, and add ours
+        var error_pop = document.getElementById('error_pop');
+        if (error_pop.style.display === 'none')
+            pop_failure(error_str);
+        else
+            error_pop.innerHTML += '<br />' + error_str;
         // keep the button visible but disabled so the user sees it is forbidden
         document.getElementById('send').style.display = 'block';
         document.getElementById('send').disabled = true;

patrick-canterino.de