From 26f7657a37847fff9ff6f6e695980c0eea4c43d4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 2 Mar 2004 14:55:32 +0000 Subject: [PATCH] (browse-url-netscape, browse-url-mozilla, browse-url-galeon, browse-url-epiphany): Encode dollar signs in URL to prevent their substitution with the environment variable values by browsers. --- lisp/net/browse-url.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 5a25801458e..d590e8bb2a4 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -818,8 +818,8 @@ When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens. - (while (string-match "[,)]" url) + ;; include at least commas; presumably also close parens and dollars. + (while (string-match "[,)$]" url) (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) @@ -889,8 +889,8 @@ When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens. - (while (string-match "[,)]" url) + ;; include at least commas; presumably also close parens and dollars. + (while (string-match "[,)$]" url) (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) @@ -942,8 +942,8 @@ When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens. - (while (string-match "[,)]" url) + ;; include at least commas; presumably also close parens and dollars. + (while (string-match "[,)$]" url) (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) @@ -991,8 +991,8 @@ When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) ;; URL encode any `confusing' characters in the URL. This needs to - ;; include at least commas; presumably also close parens. - (while (string-match "[,)]" url) + ;; include at least commas; presumably also close parens and dollars. + (while (string-match "[,)$]" url) (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) -- 2.39.2