X-Git-Url: https://git.p6c8.net/jirafeau/pcanterino.git/blobdiff_plain/71c90eed43ddf3b42af7aef81e77e6c883706f16..ed3bee3909beebe001c17710a5208ef8015a1665:/lib/functions.js.php diff --git a/lib/functions.js.php b/lib/functions.js.php index 656108b..9307eda 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -356,7 +356,7 @@ function control_selected_file_size(max_size, error_str) // just warns the user before they submit a doomed upload. function control_selected_file_extension(disallowed_extensions, error_str) { - f_name = document.getElementById('file_select').files[0].name; + f_name = document.getElementById('file_select').files[0].name.replace(/[\s.]+$/, ''); f_ext = f_name.includes('.') ? f_name.split('.').pop().toLowerCase() : ''; if (disallowed_extensions.includes(f_ext)) {