WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2014 08:29:33 PM (5 years ago)
Author:
boonebgorges
Message:

Allow apostrophes in email addresses when adding users via the Dashboard.

Email addresses entered in a number of interfaces were not being stripslashed
properly, with the result that the emails were not being recognized as valid.

Fixes #18039.

File:
1 edited

Legend:

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

    r27469 r29966  
    3939        wp_die( __( 'Cannot create an empty user.' ) );
    4040
    41     $user = $_POST['user'];
     41    $user = wp_unslash( $_POST['user'] );
    4242
    4343    $user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
     
    4646    } else {
    4747        $password = wp_generate_password( 12, false);
    48         $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
     48        $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, sanitize_email( $user['email'] ) );
    4949
    5050        if ( ! $user_id ) {
Note: See TracChangeset for help on using the changeset viewer.