emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master ce63f91025: Add textsec functions for verifying email address


From: Po Lu
Subject: Re: master ce63f91025: Add textsec functions for verifying email addresses
Date: Tue, 18 Jan 2022 21:30:39 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> +(defun textsec-name-suspicious-p (name)
> +  "Say whether NAME looks suspicious.
> +NAME is (for instance) the free-text name from an email address.
> +
> +If it suspicious, nil is returned.  If it is, a string explaining
> +the problem is returned."
> +  (cond
> +   ((not (equal name (ucs-normalize-NFC-string name)))
> +    (format "`%s' is not in normalized format `%s'"
> +            name (ucs-normalize-NFC-string name)))
> +   ((seq-find (lambda (char)
> +                (and (member char bidi-control-characters)
> +                     (not (member char
> +                                  '( ?\N{left-to-right mark}
> +                                     ?\N{right-to-left mark}
> +                                     ?\N{arabic letter mark})))))
> +              name)
> +    (format "The string contains bidirectional control characters"))
> +   ((textsec-suspicious-nonspacing-p name))))

I thought the consensus from the last discussion about this subject was
to use `bidi-find-overridden-directionality' for this kind of thing, to
avoid false positives with legitimate use of bidirectional control
characters.

Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]