Make WordPress Core

Ticket #40605: 40605.3.patch

File 40605.3.patch, 1.6 KB (added by williampatton, 5 years ago)
  • src/wp-login.php

    diff --git src/wp-login.php src/wp-login.php
    index f289c35d4b..54d876f002 100644
    if ( ! in_array( $action, $default_actions, true ) && false === has_filter( 'log 
    494494        $action = 'login';
    495495}
    496496
     497if ( isset( $_GET['checkemail'] ) && $_GET['checkemail'] ) {
     498        $action = 'check-email';
     499}
     500
    497501nocache_headers();
    498502
    499503header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );
    switch ( $action ) { 
    11511155                login_footer();
    11521156                exit;
    11531157
     1158        case 'check-email':
     1159                $secure_cookie = '';
     1160
     1161                $redirect_to = admin_url();
     1162
     1163                $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
     1164
     1165                $user   = wp_signon( array(), $secure_cookie );
     1166                $errors = $user;
     1167
     1168                // Clear errors if loggedout is set.
     1169                if ( ! empty( $_GET['loggedout'] ) || $reauth ) {
     1170                        $errors = new WP_Error();
     1171                }
     1172
     1173                if ( isset( $_GET['checkemail'] ) && 'confirm' === $_GET['checkemail'] ) {
     1174                        $errors->add(
     1175                                'confirm',
     1176                                sprintf(
     1177                                        /* Translators: 1 is a link to the login url. */
     1178                                        __( 'Check your email for the confirmation link. Then go to <a href="%1$s">Login Page</a>' ),
     1179                                        wp_login_url()
     1180                                ),
     1181                                'message'
     1182                        );
     1183                }
     1184
     1185                /**
     1186                 * Filters the login page errors.
     1187                 *
     1188                 * @since 3.6.0
     1189                 *
     1190                 * @param object $errors      WP Error object.
     1191                 * @param string $redirect_to Redirect destination URL.
     1192                 */
     1193                $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
     1194                login_header( __( 'Log In' ), '', $errors );
     1195
     1196                login_footer();
     1197                break;
     1198
    11541199        case 'login':
    11551200        default:
    11561201                $secure_cookie   = '';