Allow non-ASCII characters in file names of uploaded files (closes #2484)

This commit is contained in:
Bernd Bestel
2024-08-19 20:51:47 +02:00
parent 5a2600209f
commit c21090f522
6 changed files with 8 additions and 9 deletions

View File

@@ -95,8 +95,7 @@ $('.save-product-button').on('click', function(e)
if ($("#product-picture")[0].files.length > 0)
{
var someRandomStuff = Math.random().toString(36).substring(2, 100) + Math.random().toString(36).substring(2, 100);
jsonData.picture_file_name = someRandomStuff + CleanFileName($("#product-picture")[0].files[0].name);
jsonData.picture_file_name = RandomString() + CleanFileName($("#product-picture")[0].files[0].name);
}
const location = $(e.currentTarget).attr('data-location') == 'return' ? '/products?product=' : '/product/';