mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Fix file name sanitising to remove trailing dots. Close #322
This commit is contained in:
@@ -132,7 +132,7 @@ extension DirectoryExtension on Directory {
|
||||
|
||||
/// Sanitize the file name. Remove invalid characters and trim the file name.
|
||||
String sanitizeFileName(String fileName, {String? dir, int? maxLength}) {
|
||||
if (fileName.endsWith('.')) {
|
||||
while (fileName.endsWith('.')) {
|
||||
fileName = fileName.substring(0, fileName.length - 1);
|
||||
}
|
||||
var length = maxLength ?? 255;
|
||||
|
Reference in New Issue
Block a user