Escape percent character.

* org.el (org-fixup-message-id-for-http): Escape percent
character.
This commit is contained in:
David Maus 2010-05-28 17:11:09 +00:00 committed by John Wiegley
parent a082001643
commit 963f830b2e
1 changed files with 6 additions and 0 deletions

View File

@ -8275,6 +8275,12 @@ This is the list that is used before handing over to the browser.")
(defun org-fixup-message-id-for-http (s)
"Replace special characters in a message id, so it can be used in an http query."
(when (string-match "%" s)
(setq s (mapconcat (lambda (c)
(if (eq c ?%)
"%25"
(char-to-string c)))
s "")))
(while (string-match "<" s)
(setq s (replace-match "%3C" t t s)))
(while (string-match ">" s)