From 99bcba6a6b26b8d88ada51acfb0620eb3b8e5a97 Mon Sep 17 00:00:00 2001 From: fpi Date: Tue, 17 Sep 2024 21:56:00 +0200 Subject: Ensure proper property value quoting --- gnus-icalendar-request.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnus-icalendar-request.el') diff --git a/gnus-icalendar-request.el b/gnus-icalendar-request.el index b7e9613..498e063 100644 --- a/gnus-icalendar-request.el +++ b/gnus-icalendar-request.el @@ -90,8 +90,8 @@ (defun gnus-icalendar--format-ical-property-parameters (item) "Format a cons ITEM according to RFC5545 rules. -Car of ITEM is the value and the cdr is an alist of additional -property parameters attached to the value." +Car of ITEM is the property value and the cdr is an alist of additional +property parameters." (format "%s:%s" (seq-reduce (lambda (a b) (format "%s;%s=%s" a (car b) (cdr b))) @@ -107,7 +107,10 @@ Optional argument ALIST specifies will be appended to the entry." (append alist (when (cdr entry) - `((CN . ,(cdr entry))))))) + `((CN . ,(if (string-match "[:;,]" (cdr entry)) + ;; quote property value if necessary + (format "\"%s\"" (cdr entry)) + (cdr entry)))))))) ;;;###autoload (defun gnus-icalendar-from-message-and-insert (&optional date location) -- cgit v1.2.3