Making WordPress.org


Ignore:
Timestamp:
06/29/2021 03:33:09 AM (5 years ago)
Author:
dd32
Message:

Login: Properly URL encode parameters before passing them in the URI for internal REST API requests.

This avoids PHP Notices when bots attempt to create accounts with linebreaks in the fields.

File:
1 edited

Legend:

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

    r10990 r11073  
    367367    ) {
    368368        // Validate the email
    369         $error_user_email = rest_do_request( new WP_REST_Request( 'GET', '/wporg/v1/email-in-use/' . $new_email ) );
     369        $error_user_email = rest_do_request( new WP_REST_Request( 'GET', '/wporg/v1/email-in-use/' . urlencode( $new_email ) ) );
    370370        if ( $error_user_email->get_data()['available'] ) {
    371371            // Change their email, resend confirmation.
Note: See TracChangeset for help on using the changeset viewer.