Make WordPress Core

Ticket #40605: 40605.patch

File 40605.patch, 1.5 KB (added by bdbch, 8 years ago)
  • src/wp-login.php

    diff --git src/wp-login.php src/wp-login.php
    index d21ce15..cd35777 100644
    if ( isset($_GET['key']) ) 
    391391if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
    392392        $action = 'login';
    393393
     394if ( isset($_GET['checkemail']) && $_GET['checkemail'] )
     395        $action = 'check-email';
     396
    394397nocache_headers();
    395398
    396399header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
    case 'register' : 
    752755login_footer('user_login');
    753756break;
    754757
     758case 'check-email' :
     759        $secure_cookie = '';
     760
     761        $redirect_to = admin_url();
     762
     763        $reauth = empty($_REQUEST['reauth']) ? false : true;
     764
     765        $user = wp_signon( array(), $secure_cookie );
     766        $errors = $user;
     767        // Clear errors if loggedout is set.
     768        if ( !empty($_GET['loggedout']) || $reauth ) {
     769                $errors = new WP_Error();
     770        }
     771
     772        if ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] ) {
     773                $errors->add('confirm', __('Check your email for the confirmation link.'), 'message');
     774        }
     775
     776        /**
     777         * Filters the login page errors.
     778         *
     779         * @since 3.6.0
     780         *
     781         * @param object $errors      WP Error object.
     782         * @param string $redirect_to Redirect destination URL.
     783         */
     784        $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
     785        login_header(__('Log In'), '', $errors);
     786
     787login_footer();
     788break;
     789   
    755790case 'login' :
    756791default:
    757792        $secure_cookie = '';