Differentiate between invalid and missing admin emails when adding a new site
Check the emptiness of the admin email before using `sanitize_email()` and `is_email()` to determine if the address is valid. Fixes #17890 Built from https://develop.svn.wordpress.org/trunk@29877 git-svn-id: http://core.svn.wordpress.org/trunk@29634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7f2f3dcb5d
commit
1ffba4abc4
|
@ -49,15 +49,19 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
|
||||||
wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
|
wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = sanitize_email( $blog['email'] );
|
|
||||||
$title = $blog['title'];
|
$title = $blog['title'];
|
||||||
|
|
||||||
if ( empty( $domain ) )
|
if ( empty( $domain ) )
|
||||||
wp_die( __( 'Missing or invalid site address.' ) );
|
wp_die( __( 'Missing or invalid site address.' ) );
|
||||||
if ( empty( $email ) )
|
|
||||||
|
if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
|
||||||
wp_die( __( 'Missing email address.' ) );
|
wp_die( __( 'Missing email address.' ) );
|
||||||
if ( !is_email( $email ) )
|
}
|
||||||
|
|
||||||
|
$email = sanitize_email( $blog['email'] );
|
||||||
|
if ( ! is_email( $email ) ) {
|
||||||
wp_die( __( 'Invalid email address.' ) );
|
wp_die( __( 'Invalid email address.' ) );
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_subdomain_install() ) {
|
if ( is_subdomain_install() ) {
|
||||||
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
|
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.1-alpha-20141011';
|
$wp_version = '4.1-alpha-20141012';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue