summaryrefslogtreecommitdiff
path: root/lisp/nxml
diff options
context:
space:
mode:
authorMartin Jerabek <om@mailservice.ms>2022-10-24 12:02:20 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-10-24 12:22:41 +0200
commitaa793512d04c53e423563530f64c1d42d7d0accd (patch)
treee05eeb85f25bd19a272b3e5d63c681ab29ab870b /lisp/nxml
parent36f5a1a7e74442272796413575f85ba9bd18cb53 (diff)
downloademacs-aa793512d04c53e423563530f64c1d42d7d0accd.tar.gz
Repair nXML handling of URIs with hex escapes (bug#58718)
Copyright-paperwork-exempt: yes * lisp/nxml/rng-uri.el (rng-uri-file-name-1): Add missing backslashes. (rng-uri-unescape-unibyte, rng-uri-unescape-unibyte-match): Convert hex-encoded character to string.
Diffstat (limited to 'lisp/nxml')
-rw-r--r--lisp/nxml/rng-uri.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el
index 77fed8c32da..59e696e2cc9 100644
--- a/lisp/nxml/rng-uri.el
+++ b/lisp/nxml/rng-uri.el
@@ -68,7 +68,7 @@ Signal an error if URI is not a valid file URL."
;; pattern is either nil or match or replace
(defun rng-uri-file-name-1 (uri pattern)
- (unless (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]]{2}\\)*\\'" uri)
+ (unless (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]]\\{2\\}\\)*\\'" uri)
(rng-uri-error "Bad escapes in URI `%s'" uri))
(setq uri (rng-uri-unescape-multibyte uri))
(let* ((components
@@ -312,7 +312,7 @@ Both FULL and BASE must be absolute URIs."
(defun rng-uri-unescape-unibyte (str)
(replace-regexp-in-string "%[0-7][[:xdigit:]]"
(lambda (h)
- (string-to-number (substring h 1) 16))
+ (string (string-to-number (substring h 1) 16)))
str
t
t))
@@ -325,8 +325,8 @@ Both FULL and BASE must be absolute URIs."
(regexp-quote
(if (= (length match) 1)
match
- (string-to-number (substring match 1)
- 16)))))
+ (string (string-to-number (substring match 1)
+ 16))))))
str
t
t))