* 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.
(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)
(textsec-email-address-header-suspicious-p
"Lars Ingebrigtsen <larsi@gn\N{LEFT-TO-RIGHT ISOLATE}us.org>"))
+ (should
+ (textsec-email-address-header-suspicious-p
+ "Lars Ingebrigtsen <larsi@\N{RIGHT-TO-LEFT OVERRIDE}gnus.org>"))
+
(should (textsec-email-address-header-suspicious-p
"דגבא <foo@bar.com>")))