Ticket #2039: 2039.refreshed.diff

File 2039.refreshed.diff, 1.5 kB (added by westi, 1 year ago)

Refreshed patch

  • wp-login.php

    old new  
    2020                update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); 
    2121} 
    2222 
     23//Set a cookie now to see if they are supported by the browser. 
     24setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); 
    2325 
    2426// Rather than duplicating this HTML all over the place, we'll stick it in function 
    2527function login_header($title = 'Login', $message = '') { 
     
    307309 
    308310        do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass)); 
    309311 
     312        // If cookies are disabled we can't log in even with a valid user+pass 
     313        if ( $_POST && empty($_COOKIE[TEST_COOKIE]) ) 
     314                $errors['test_cookie'] = __('<strong>ERROR</strong>: WordPress requires Cookies but your browser does not support them or they are blocked.'); 
     315 
    310316        if ( $user_login && $user_pass && empty( $errors ) ) { 
    311317                $user = new WP_User(0, $user_login); 
    312318 
  • wp-settings.php

    old new  
    206206        define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH); 
    207207if ( !defined('PASS_COOKIE') ) 
    208208        define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH); 
     209if ( !defined('TEST_COOKIE') ) 
     210        define('TEST_COOKIE', 'wordpress_test_cookie'); 
    209211if ( !defined('COOKIEPATH') ) 
    210212        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 
    211213if ( !defined('SITECOOKIEPATH') )