GNU bug report logs -
#70312
[PATCH] Avoid unnecessary escaping in url-build-query-string
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#70312: [PATCH] Avoid unnecessary escaping in url-build-query-string
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 70312 <at> debbugs.gnu.org.
--
70312: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70312
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Dagfinn Ilmari Mannsåker <ilmari <at> ilmari.org>
> Date: Tue, 09 Apr 2024 17:41:07 +0100
>
> I realised I'd forgotten to add tests, and that made me realise that
> url-query-allowed-chars is not correct for this, since that also
> contains '=', '&', and ';'. So here's an updated patch, which creates a
> new url-query-key-value-allowed-chars constant, which is
> url-query-allowed-chars minus the aforementioned three chars, and adds
> tests covering that, for both keys and values.
Thanks, I installed this on the master branch, and I'm closing this
bug.
With this contribution, you have exhausted the maximum amount of code
changes we can accept from you without a copyright assignment. Would
you like to start your assignment paperwork now, so that we could
accept your future contributions without limitations? If yes, I will
send you a form to fill and the instructions to go with it.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
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
[0001-Avoid-unnecessary-escaping-in-url-build-query-string.patch (text/x-diff, inline)]
From ca1dbe67939ac78f5db06d746cd511928a138657 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari <at> 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
This bug report was last modified 1 year and 4 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.