]> git.eshelyaron.com Git - emacs.git/commitdiff
Make more IPV6 domains non-suspicious in textsec
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 11 Apr 2022 15:36:26 +0000 (17:36 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 11 Apr 2022 15:36:26 +0000 (17:36 +0200)
* lisp/international/textsec.el (textsec--ipvx-address-p): Make
more IPV6 domains non-suspicious.

lisp/international/textsec.el

index 3e7879093843eb2386a67a04ae0f71bca0853ded..82eba1b5d51b6d61b379e55e2a7731c8c3caa552 100644 (file)
@@ -236,15 +236,16 @@ The scripts are as defined by the Unicode Standard Annex 24 (UAX#24)."
   ;; This is a very relaxed pattern for IPv4 or IPv6 addresses.  The
   ;; assumption is that any malformed address accepted by this rule
   ;; will be rejected by the actual address parser eventually.
-  (rx-let ((ipv4 (** 1 4
-                     (** 1 3 (in "0-9"))
-                     (? ".")))
-           (ipv6 (: (** 1 7
-                        (** 0 4 (in "0-9a-f"))
-                        ":")
-                    (** 0 4 (in "0-9a-f"))
-                    (? ":" ipv4))))
-    (string-match-p (rx bos (or ipv4 ipv6 (: "[" ipv6 "]")) eos) domain)))
+  (let ((case-fold-search t))
+    (rx-let ((ipv4 (** 1 4
+                       (** 1 3 (in "0-9"))
+                       (? ".")))
+             (ipv6 (: (** 1 7
+                          (** 0 4 (in "0-9a-f"))
+                          ":")
+                      (** 0 4 (in "0-9a-f"))
+                      (? ":" ipv4))))
+      (string-match-p (rx bos (or ipv4 ipv6 (: "[" ipv6 "]")) eos) domain))))
 
 (defun textsec-domain-suspicious-p (domain)
   "Say whether DOMAIN's name looks suspicious.