* [PATCH] Escape percent character in `org-fixup-message-id-for-http'
@ 2010-05-28 12:11 David Maus
2010-05-28 12:11 ` [PATCH] Escape percent character David Maus
0 siblings, 1 reply; 2+ messages in thread
From: David Maus @ 2010-05-28 12:11 UTC (permalink / raw)
To: emacs-orgmode
A message id header field can contain the percent sign which must be
escaped in the context of a url.
David Maus (1):
Escape percent character.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] Escape percent character.
2010-05-28 12:11 [PATCH] Escape percent character in `org-fixup-message-id-for-http' David Maus
@ 2010-05-28 12:11 ` David Maus
0 siblings, 0 replies; 2+ messages in thread
From: David Maus @ 2010-05-28 12:11 UTC (permalink / raw)
To: emacs-orgmode
* org.el (org-fixup-message-id-for-http): Escape percent
character.
---
lisp/org.el | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 33f395b..00de5dc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8273,6 +8273,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)
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-28 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 12:11 [PATCH] Escape percent character in `org-fixup-message-id-for-http' David Maus
2010-05-28 12:11 ` [PATCH] Escape percent character David Maus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).