mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Strip spaces from uploaded file names (fixes #2415)
This commit is contained in:
@@ -200,7 +200,12 @@ function QrCodeImgHtml(text)
|
||||
function CleanFileName(fileName)
|
||||
{
|
||||
// Umlaute seem to cause problems on Linux...
|
||||
return fileName.toLowerCase().replaceAll(/ä/g, 'ae').replaceAll(/ö/g, 'oe').replaceAll(/ü/g, 'ue').replaceAll(/ß/g, 'ss');
|
||||
fileName = fileName.toLowerCase().replaceAll(/ä/g, 'ae').replaceAll(/ö/g, 'oe').replaceAll(/ü/g, 'ue').replaceAll(/ß/g, 'ss');
|
||||
|
||||
// Multiple spaces seem to be a problem, so simply strip them all
|
||||
fileName = fileName.replace(/\s+/g, "");
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
function nl2br(s)
|
||||
|
Reference in New Issue
Block a user