Skip to content

Commit 141c61b

Browse files
committed
Add scaffolding for hypthetical new Unicode email functions
1 parent 929919e commit 141c61b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/wp-includes/formatting.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,6 +3624,28 @@ function is_email( $email, $deprecated = false ) {
36243624
return apply_filters( 'is_email', $email, $email, null );
36253625
}
36263626

3627+
$u = new Uri\WhatWg\Url('blar');
3628+
$u->getAsciiHost()
3629+
3630+
function is_unicode_email_filter( $ignored_filtered_email, $originally_provided_email, $ignored_message ) {
3631+
remove_filter( 'is_email', 'is_unicode_email_filter' );
3632+
$result = is_unicode_email( $originally_provided_email );
3633+
add_filter( 'is_email', 'is_unicode_email_filter', 8, 3 );
3634+
3635+
return $result;
3636+
}
3637+
3638+
function is_unicode_email( $email ) {
3639+
$email = WP_Email_Address::from_string( $email );
3640+
if ( null === $email ) {
3641+
return apply_filters( 'is_email', false, $email, 'non_parsable_email' );
3642+
}
3643+
3644+
...
3645+
3646+
return apply_filters( 'is_email', $email, $email, null );
3647+
}
3648+
36273649
/**
36283650
* Converts to ASCII from email subjects.
36293651
*

0 commit comments

Comments
 (0)