From: Lars Ingebrigtsen Date: Thu, 20 Jan 2022 06:45:33 +0000 (+0100) Subject: Improve textsec-domain-suspicious-p message X-Git-Tag: emacs-29.0.90~2920 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e7974154b902f53dd1646ec0246b9e8b7c32824;p=emacs.git Improve textsec-domain-suspicious-p message * lisp/international/textsec.el (textsec-domain-suspicious-p): Ensure that we're not confusing the user if there's a directional override in the string we're checking. --- diff --git a/lisp/international/textsec.el b/lisp/international/textsec.el index bf90afb7c00..6b37e925698 100644 --- a/lisp/international/textsec.el +++ b/lisp/international/textsec.el @@ -244,8 +244,11 @@ or use certain other unusual mixtures of characters." (seq-do (lambda (char) (when (eq (elt idna-mapping-table char) t) - (throw 'found (format "Disallowed character: `%s' (#x%x)" - (string char) char)))) + (throw 'found + (format "Disallowed character: `%s' (#x%x, %s)" + (bidi-string-strip-control-characters (string char)) + char + (get-char-code-property char 'name))))) domain) ;; Does IDNA allow it? (unless (puny-highly-restrictive-domain-p domain) diff --git a/test/lisp/international/textsec-tests.el b/test/lisp/international/textsec-tests.el index acd77971501..f8fc0564807 100644 --- a/test/lisp/international/textsec-tests.el +++ b/test/lisp/international/textsec-tests.el @@ -162,6 +162,10 @@ (textsec-email-address-header-suspicious-p "Lars Ingebrigtsen ")) + (should + (textsec-email-address-header-suspicious-p + "Lars Ingebrigtsen ")) + (should (textsec-email-address-header-suspicious-p "דגבא ")))