From ca84906d7ddb1351643998efaa56086e3ba9cf8e Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 3 Jul 2022 13:32:01 +0300 Subject: [PATCH] notifications: escape all quotes in applescript on macos --- src/components/notifications.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/notifications.rs b/src/components/notifications.rs index 5e5dcf14..1d676e66 100644 --- a/src/components/notifications.rs +++ b/src/components/notifications.rs @@ -213,7 +213,7 @@ impl Component for NotificationCommand { } else { #[cfg(target_os = "macos")] { - let applescript = format!("display notification \"{message}\" with title \"{title}\" subtitle \"{subtitle}\"", message = body.replace('"', "'"), title = title.as_ref().map(String::as_str).unwrap_or("meli"), subtitle = kind.map(|k| k.to_string()).unwrap_or_default()); + let applescript = format!("display notification \"{message}\" with title \"{title}\" subtitle \"{subtitle}\"", message = body.replace('"', "'"), title = title.as_ref().map(String::as_str).unwrap_or("meli").replace('"', "'"), subtitle = kind.map(|k| k.to_string()).unwrap_or_default().replace('"', "'")); match Command::new("osascript") .arg("-e") .arg(applescript)