WordPress.org

Make WordPress Core

Ticket #17890: 17890.3.diff

File 17890.3.diff, 1.0 KB (added by jeremyfelt, 5 years ago)
  • src/wp-admin/network/site-new.php

     
    4949                        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 ) ) );
    5050        }
    5151
    52         $email = sanitize_email( $blog['email'] );
    5352        $title = $blog['title'];
    5453
    5554        if ( empty( $domain ) )
    5655                wp_die( __( 'Missing or invalid site address.' ) );
    57         if ( empty( $email ) )
     56
     57        if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
    5858                wp_die( __( 'Missing email address.' ) );
    59         if ( !is_email( $email ) )
     59        }
     60
     61        $email = sanitize_email( $blog['email'] );
     62        if ( ! is_email( $email ) ) {
    6063                wp_die( __( 'Invalid email address.' ) );
     64        }
    6165
    6266        if ( is_subdomain_install() ) {
    6367                $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );