Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e17c5b47 authored by Siyamed Sinir's avatar Siyamed Sinir
Browse files

Fix email auto link when there are two chars in local part

Email auto linking used to accept either a single char or more than 2
chars in the local part. Updated the regular expression to accept 1 or
more chars.

Test: added test to cts.LinkifyTest
Test: bit -t CtsTextTestCases:android.text.util.cts.LinkifyTest
Test: bit -t FrameworksCoreTests:android.util.PatternsTest
Test: bit -t FrameworksCoreTests:android.text.util.LinkifyTest
Test: bit -t CtsWidgetTestCases:android.widget.cts.TextViewTest

Bug: 64467661
Change-Id: I4e28a344ff1bc50da353b9490eaaec99a751bffb
parent a593003a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -406,7 +406,7 @@ public class Patterns {
     * the local part to be at most 64 octets.
     * the local part to be at most 64 octets.
     */
     */
    private static final String EMAIL_ADDRESS_LOCAL_PART =
    private static final String EMAIL_ADDRESS_LOCAL_PART =
            "[" + EMAIL_CHAR + "]" + "(?:[" + EMAIL_CHAR + "\\.]{1,62}[" + EMAIL_CHAR + "])?";
            "[" + EMAIL_CHAR + "]" + "(?:[" + EMAIL_CHAR + "\\.]{0,62}[" + EMAIL_CHAR + "])?";


    /**
    /**
     * Regular expression for the domain part of an email address. RFC5321 section 4.5.3.1.2 limits
     * Regular expression for the domain part of an email address. RFC5321 section 4.5.3.1.2 limits