mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
Switch to sanitize-filename-reader-friendly
One advantage is that it does not depend on any crates, so there is a higher chance of dropping regex crate eventually.
This commit is contained in:
committed by
link2xt
parent
07236efc45
commit
93797bc82f
@@ -320,13 +320,8 @@ impl<'a> BlobObject<'a> {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let opts = sanitize_filename::Options {
|
||||
truncate: true,
|
||||
windows: true,
|
||||
replacement: "",
|
||||
};
|
||||
|
||||
let clean = sanitize_filename::sanitize_with_options(name, opts);
|
||||
let clean = sanitize_filename_reader_friendly::sanitize(&name);
|
||||
let mut iter = clean.splitn(2, '.');
|
||||
let stem: String = iter.next().unwrap_or_default().chars().take(64).collect();
|
||||
let ext: String = iter.next().unwrap_or_default().chars().take(32).collect();
|
||||
|
||||
Reference in New Issue
Block a user