From: Chong Yidong Date: Sat, 2 Jan 2010 20:14:54 +0000 (-0500) Subject: * net/browse-url.el (browse-url-encode-url): Don't escape commas. X-Git-Tag: emacs-pretest-23.1.92~92 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da76998b6863a34fc3f81765bd706a08256b9af7;p=emacs.git * net/browse-url.el (browse-url-encode-url): Don't escape commas. They are valid characters in URL paths (rfc3986), and at least Firefox does not understand the encoded version (Bug#3166). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a6ca9dd4dde..cfde9093e75 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-01-02 Chong Yidong + + * net/browse-url.el (browse-url-encode-url): Don't escape commas. + They are valid characters in URL paths (rfc3986), and at least + Firefox does not understand the encoded version (Bug#3166). + 2010-01-02 Daniel Elliott (tiny change) * progmodes/octave-mod.el (octave-end-keywords) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index e52f4cb924a..5619108241c 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -613,7 +613,7 @@ down (this *won't* always work)." (defun browse-url-url-encode-chars (text chars) "URL-encode the chars in TEXT that match CHARS. -CHARS is a regexp-like character alternative (e.g., \"[,)$]\")." +CHARS is a regexp-like character alternative (e.g., \"[)$]\")." (let ((encoded-text (copy-sequence text)) (s 0)) (while (setq s (string-match chars encoded-text s)) @@ -626,10 +626,12 @@ CHARS is a regexp-like character alternative (e.g., \"[,)$]\")." (defun browse-url-encode-url (url) "Escape annoying characters in URL. -The annoying characters are those that can mislead a webbrowser -regarding its parameter treatment. For instance, `,' can -be misleading because it could be used to separate URLs." - (browse-url-url-encode-chars url "[,)$]")) +The annoying characters are those that can mislead a web browser +regarding its parameter treatment." + ;; FIXME: Is there an actual example of a web browser getting + ;; confused? (This used to encode commas, but at least Firefox + ;; handles commas correctly and doesn't accept encoded commas.) + (browse-url-url-encode-chars url "[)$]")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; URL input