From: "Dagfinn Ilmari Mannsåker" <ilmari@ilmari.org>
To: 70312@debbugs.gnu.org
Subject: bug#70312: [PATCH] Avoid unnecessary escaping in url-build-query-string
Date: Tue, 09 Apr 2024 15:29:00 +0100 [thread overview]
Message-ID: <8734ruk3tf.fsf@wibble.ilmari.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 261 bytes --]
Hi,
While writing a custom URL function for git-link.el I noticed that
url-build-query-string unnecessarily escapes slashes in query parameter
values. Here's a patch that fixes that by passing
url-query-allowed-chars to the url-hexify-string call.
- ilmari
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Avoid-unnecessary-escaping-in-url-build-query-string.patch --]
[-- Type: text/x-diff, Size: 1180 bytes --]
From ca1dbe67939ac78f5db06d746cd511928a138657 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Tue, 9 Apr 2024 15:02:45 +0100
Subject: [PATCH] Avoid unnecessary escaping in url-build-query-string
* lisp/url/url-util.el (url-build-query-string):
Pass url-query-allowed-chars to url-hexify-string to avoid unnecessarily
escaping characters that don't need to be escaped in a query string.
---
lisp/url/url-util.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 5f45b98c7a5..4fc0efcdf62 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -268,7 +268,8 @@ instead of just \"key\" as in the example above."
(lambda (key-vals)
(let ((escaped
(mapcar (lambda (sym)
- (url-hexify-string (format "%s" sym))) key-vals)))
+ (url-hexify-string (format "%s" sym) url-query-allowed-chars))
+ key-vals)))
(mapconcat (lambda (val)
(let ((vprint (format "%s" val))
(eprint (format "%s" (car escaped))))
--
2.39.2
next reply other threads:[~2024-04-09 14:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 14:29 Dagfinn Ilmari Mannsåker [this message]
2024-04-09 16:41 ` bug#70312: [PATCH v2] Avoid unnecessary escaping in url-build-query-string Dagfinn Ilmari Mannsåker
2024-04-18 10:10 ` Eli Zaretskii
2024-05-19 11:18 ` Philip Kaludercic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8734ruk3tf.fsf@wibble.ilmari.org \
--to=ilmari@ilmari.org \
--cc=70312@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.