Making WordPress.org

Changeset 11081


Ignore:
Timestamp:
06/30/2021 12:25:52 AM (5 years ago)
Author:
dd32
Message:

Login: URIEncode emails/usernames in the HTTP request to preserve all characters.

Follow up to r11073

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
3 edited

Legend:

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

    r10941 r11081  
    3333
    3434function wporg_login_rest_username_exists( $request ) {
    35         $login = trim( $request['login'] );
     35        $login = trim( urldecode( $request['login'] ) );
    3636
    3737        $validate_signup = wpmu_validate_user_signup( $login, 'placeholder@placeholder.domain' );
    … …  
    7373
    7474function wporg_login_rest_email_in_use( $request ) {
    75         $email = trim( $request['email'] );
     75        $email = trim( urldecode( $request['email'] ) );
    7676
    7777        if ( $user = get_user_by( 'email', $email ) ) {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r11049 r11081  
    9898        );
    9999
    100         wp_register_script( 'wporg-registration', get_template_directory_uri() . '/js/registration.js', array( 'recaptcha-api', 'jquery' ), '20210517' );
     100        wp_register_script( 'wporg-registration', get_template_directory_uri() . '/js/registration.js', array( 'recaptcha-api', 'jquery' ), filemtime( __DIR__ . '/js/registration.js' ) );
    101101        wp_localize_script( 'wporg-registration', 'wporg_registration', array(
    102102                'rest_url' => esc_url_raw( rest_url( 'wporg/v1' ) )
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js

    r10981 r11081  
    1717                                var rest_url = wporg_registration.rest_url +
    1818                                        ( this.id == 'user_login' ? '/username-available/' : '/email-in-use/' ) +
    19                                         $this.val();
     19                                        encodeURIComponent( $this.val() );
    2020
    2121                                $.get( rest_url, function( datas ) {
Note: See TracChangeset for help on using the changeset viewer.