WordPress.org

Make WordPress Core

Changeset 25045


Ignore:
Timestamp:
08/17/2013 01:00:25 AM (8 years ago)
Author:
azaozz
Message:

In wp-login.php check if cookies are enabled before attempting to log the user in with wp_signon(), fixes #24961.

File:
1 edited

Legend:

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

    r25001 r25045  
    620620        $secure_cookie = false;
    621621
    622     $user = wp_signon('', $secure_cookie);
     622    // If cookies are disabled we can't log in even with a valid user+pass
     623    if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
     624        $user = new WP_Error('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
     625    else
     626        $user = wp_signon('', $secure_cookie);
    623627
    624628    $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
     
    655659    if ( !empty($_GET['loggedout']) || $reauth )
    656660        $errors = new WP_Error();
    657 
    658     // If cookies are disabled we can't log in even with a valid user+pass
    659     if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
    660         $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
    661661
    662662    if ( $interim_login ) {
Note: See TracChangeset for help on using the changeset viewer.