WordPress.org

Make WordPress Core

Changeset 29877


Ignore:
Timestamp:
10/12/2014 12:21:02 AM (5 years ago)
Author:
jeremyfelt
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r29030 r29877  
    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() ) {
Note: See TracChangeset for help on using the changeset viewer.