changeset 106717:15eb515afd85

* 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).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 02 Jan 2010 15:14:54 -0500
parents 4039413a8b1d
children afc2be124e6e
files lisp/ChangeLog lisp/net/browse-url.el
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 02 14:40:59 2010 -0500
+++ b/lisp/ChangeLog	Sat Jan 02 15:14:54 2010 -0500
@@ -1,3 +1,9 @@
+2010-01-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* 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  <danelliottster@gmail.com>  (tiny change)
 
 	* progmodes/octave-mod.el (octave-end-keywords)
--- a/lisp/net/browse-url.el	Sat Jan 02 14:40:59 2010 -0500
+++ b/lisp/net/browse-url.el	Sat Jan 02 15:14:54 2010 -0500
@@ -613,7 +613,7 @@
 
 (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 @@
 
 (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