Make WordPress Core

Changeset 8731


Ignore:
Timestamp:
08/25/2008 09:09:26 PM (18 years ago)
Author:
ryan
Message:

Don't ignore scheme when cookie value is empty. Props bendalton. fixes #7521

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r8730 r8731  
    485485 * @return bool|int False if invalid cookie, User ID if valid.
    486486 */
    487 function wp_validate_auth_cookie($cookie = '', $scheme = 'auth') {
     487function wp_validate_auth_cookie($cookie = '', $scheme = '') {
    488488        if ( ! $cookie_elements = wp_parse_auth_cookie($cookie, $scheme) ) {
    489489                do_action('auth_cookie_malformed', $cookie, $scheme);
    … …  
    560560 * @return array Authentication cookie components
    561561 */
    562 function wp_parse_auth_cookie($cookie = '', $scheme = 'auth') {
     562function wp_parse_auth_cookie($cookie = '', $scheme = '') {
    563563        if ( empty($cookie) ) {
    564                 if ( is_ssl() ) {
    565                         $cookie_name = SECURE_AUTH_COOKIE;
    566                         $scheme = 'secure_auth';
    567                 } else {
    568                         $cookie_name = AUTH_COOKIE;
    569                         $scheme = 'auth';
    570                 }
     564                switch ($scheme){
     565                        case 'auth':
     566                                $cookie_name = AUTH_COOKIE;
     567                                break;
     568                        case 'secure_auth':
     569                                $cookie_name = SECURE_AUTH_COOKIE;
     570                                break;
     571                        case "logged_in":
     572                                $cookie_name = LOGGED_IN_COOKIE;
     573                                break;
     574                        default:
     575                                if ( is_ssl() ) {
     576                                        $cookie_name = SECURE_AUTH_COOKIE;
     577                                        $scheme = 'secure_auth';
     578                                } else {
     579                                        $cookie_name = AUTH_COOKIE;
     580                                        $scheme = 'auth';
     581                                }
     582            }
    571583
    572584                if ( empty($_COOKIE[$cookie_name]) )
Note: See TracChangeset for help on using the changeset viewer.