Changeset 7822
- Timestamp:
- 04/25/08 06:20:50 (7 months ago)
- Files:
-
- branches/2.5/wp-includes/pluggable.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.5/wp-includes/pluggable.php
r7803 r7822 475 475 } 476 476 477 list($username, $expiration, $hmac) = explode('|', $cookie); 477 $cookie_elements = explode('|', $cookie); 478 if ( count($cookie_elements) != 3 ) 479 return false; 480 481 list($username, $expiration, $hmac) = $cookie_elements; 478 482 479 483 $expired = $expiration; … … 483 487 $expired += 3600; 484 488 489 // Quick check to see if an honest cookie has expired 485 490 if ( $expired < time() ) 486 491 return false; 487 492 488 $key = wp_hash($username . $expiration);489 $hash = hash_hmac('md5', $username . $expiration, $key);493 $key = wp_hash($username . '|' . $expiration); 494 $hash = hash_hmac('md5', $username . '|' . $expiration, $key); 490 495 491 496 if ( $hmac != $hash ) … … 515 520 $user = get_userdata($user_id); 516 521 517 $key = wp_hash($user->user_login . $expiration);518 $hash = hash_hmac('md5', $user->user_login . $expiration, $key);522 $key = wp_hash($user->user_login . '|' . $expiration); 523 $hash = hash_hmac('md5', $user->user_login . '|' . $expiration, $key); 519 524 520 525 $cookie = $user->user_login . '|' . $expiration . '|' . $hash;
