diff --git a/src/wp-includes/class-wp-email-address.php b/src/wp-includes/class-wp-email-address.php new file mode 100644 index 0000000000000..5c46a53b5f3aa --- /dev/null +++ b/src/wp-includes/class-wp-email-address.php @@ -0,0 +1,246 @@ +localpart = $localpart; + $this->domain = $domain; + } + + /** + * Creates a WP_Email_Address from a string. + * + * This method is intended to accept all strings that are considered valid email + * addresses by the WHATWG HTML specification for the email input type: + * + * https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email) + * + * and some additional addresses, while rejecting strings that + * are more likely to be typos, mispastes, or attacks. This class + * may reject a few address that are valid according to RFC 5322, + * but it always accepts an address if it's valid according to + * WHATWG. Put differently: If users can type an address into + * the major browsers of 2026, this class accepts them, if + * they can't (in 2026), this class may or may not. (Note that + * "