Making WordPress.org


Ignore:
Timestamp:
02/02/2022 08:40:57 AM (4 years ago)
Author:
dd32
Message:

Login: Run the wp_insert_user() filters during the registration process.

This prevent filters/errors that occur during the pending->user account process not being surfaced during registration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php

    r11081 r11505  
    7575    $email = trim( urldecode( $request['email'] ) );
    7676
     77    if ( ! is_email( $email ) ) {
     78        return [
     79            'available' => false,
     80            'error' => __( 'That email address appears to be invalid.', 'wporg' ),
     81        ];
     82    }
     83
    7784    if ( $user = get_user_by( 'email', $email ) ) {
    7885        return [
     
    8895
    8996    // And that there's no pending account signups for other emails for that inbox.
    90     if ( ! $pending && false !== strpos( $email, '+' ) ) {
     97    if ( ! $pending && str_contains( $email, '+' ) ) {
    9198        $pending = wporg_get_pending_user_by_email_wildcard( $email );
    9299    }
Note: See TracChangeset for help on using the changeset viewer.