diff options
| author | Hong Xu | 2019-10-14 06:46:47 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-14 06:46:47 +0200 |
| commit | 9aa13cd4beccfe41e8f4930cb029bd60e7788e93 (patch) | |
| tree | 93968ba332ad4623b8251d081175641f7146c1dc /lisp | |
| parent | 8aeba640460adbad283d4a18f91cce8e0364c40d (diff) | |
| download | emacs-9aa13cd4beccfe41e8f4930cb029bd60e7788e93.tar.gz emacs-9aa13cd4beccfe41e8f4930cb029bd60e7788e93.zip | |
Make url-hexify-string accept a list of allowed chars (bug#26469)
* lisp/url/url-util.el (url-hexify-string): Accept a list of allowed
chars.
* doc/misc/url.texi (URI Encoding): Update url-hexify-string doc and
index improvements (bug#24694).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/url/url-util.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index a390723e73d..223a6ba9829 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el | |||
| @@ -395,9 +395,12 @@ string: \"%\" followed by two upper-case hex digits. | |||
| 395 | 395 | ||
| 396 | The allowed characters are specified by ALLOWED-CHARS. If this | 396 | The allowed characters are specified by ALLOWED-CHARS. If this |
| 397 | argument is nil, the list `url-unreserved-chars' determines the | 397 | argument is nil, the list `url-unreserved-chars' determines the |
| 398 | allowed characters. Otherwise, ALLOWED-CHARS should be a vector | 398 | allowed characters. Otherwise, ALLOWED-CHARS should be either a |
| 399 | whose Nth element is non-nil if character N is allowed." | 399 | list of allowed chars, or a vector whose Nth element is non-nil |
| 400 | (unless allowed-chars | 400 | if character N is allowed." |
| 401 | (if allowed-chars | ||
| 402 | (unless (vectorp allowed-chars) | ||
| 403 | (setq allowed-chars (url--allowed-chars allowed-chars))) | ||
| 401 | (setq allowed-chars (url--allowed-chars url-unreserved-chars))) | 404 | (setq allowed-chars (url--allowed-chars url-unreserved-chars))) |
| 402 | (mapconcat (lambda (byte) | 405 | (mapconcat (lambda (byte) |
| 403 | (if (aref allowed-chars byte) | 406 | (if (aref allowed-chars byte) |