mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-10 22:41:58 +03:00
Fix insecure extension check in read_sheet_file and run cargo fmt
Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
parent
5b115d27f7
commit
f65806403a
1 changed files with 4 additions and 6 deletions
|
|
@ -938,12 +938,10 @@ fn load_extensions(app: AppHandle) -> Vec<ExtensionScript> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_sheet_path(path: &str) -> bool {
|
fn is_sheet_path(path: &str) -> bool {
|
||||||
std::path::Path::new(path)
|
std::path::Path::new(path).extension().map_or(false, |ext| {
|
||||||
.extension()
|
let ext = ext.to_string_lossy().to_lowercase();
|
||||||
.map_or(false, |ext| {
|
ext == "numi" || ext == "sum"
|
||||||
let ext = ext.to_string_lossy().to_lowercase();
|
})
|
||||||
ext == "numi" || ext == "sum"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A sheet handed to us by the OS (file association, second launch): same
|
/// A sheet handed to us by the OS (file association, second launch): same
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue