Make WordPress Core


Ignore:
Timestamp:
04/06/2018 07:09:53 PM (8 years ago)
Author:
azaozz
Message:

Privacy: fixes and updates for the method to confirm user requests by email.

  • Improve function and variable names.
  • Allow extra data to be passed with the request.
  • Make the option/user meta names more consistent.
  • Adds an inline comment explaining use of hash.

Props mikejolley.
See #43443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r42892 r42964  
    428428
    429429// validate action so as to default to the login screen
    430 if ( ! in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login', 'emailconfirm' ), true ) && false === has_filter( 'login_form_' . $action ) ) {
     430if ( ! in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login', 'verifyaccount' ), true ) && false === has_filter( 'login_form_' . $action ) ) {
    431431        $action = 'login';
    432432}
     
    859859                break;
    860860
    861         case 'emailconfirm' :
     861        case 'verifyaccount' :
    862862                if ( isset( $_GET['confirm_action'], $_GET['confirm_key'], $_GET['uid'] ) ) {
    863                         $action_name = sanitize_key( wp_unslash( $_GET['confirm_action'] ) );
    864863                        $key         = sanitize_text_field( wp_unslash( $_GET['confirm_key'] ) );
    865864                        $uid         = sanitize_text_field( wp_unslash( $_GET['uid'] ) );
    866                         $result      = check_confirm_account_action_key( $action_name, $key, $uid );
     865                        $action_name = sanitize_key( wp_unslash( $_GET['confirm_action'] ) );
     866                        $result      = wp_check_account_verification_key( $key, $uid, $action_name );
    867867                } else {
    868868                        $result = new WP_Error( 'invalid_key', __( 'Invalid key' ) );
Note: See TracChangeset for help on using the changeset viewer.