Fix insecure extension check in read_sheet_file

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-10-07 04:10:06 +00:00
parent bede889ced
commit 5b115d27f7

View file

@ -938,8 +938,12 @@ fn load_extensions(app: AppHandle) -> Vec<ExtensionScript> {
} }
fn is_sheet_path(path: &str) -> bool { fn is_sheet_path(path: &str) -> bool {
let lower = path.to_lowercase(); std::path::Path::new(path)
lower.ends_with(".numi") || lower.ends_with(".sum") .extension()
.map_or(false, |ext| {
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