- Timestamp:
- 06/21/2013 03:00:26 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-includes/post-template.php (modified) (2 diffs)
-
wp-login.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r24377 r24466 589 589 */ 590 590 function post_password_required( $post = null ) { 591 global $wp_hasher;592 593 591 $post = get_post($post); 594 592 … … 599 597 return true; 600 598 601 if ( empty( $wp_hasher ) ) { 602 require_once( ABSPATH . 'wp-includes/class-phpass.php'); 603 // By default, use the portable hash from phpass 604 $wp_hasher = new PasswordHash(8, true); 605 } 599 require_once ABSPATH . 'wp-includes/class-phpass.php'; 600 $hasher = new PasswordHash( 8, true ); 606 601 607 602 $hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ); 608 609 return ! $wp_hasher->CheckPassword( $post->post_password, $hash ); 603 if ( 0 !== strpos( $hash, '$P$B' ) ) 604 return true; 605 606 return ! $hasher->CheckPassword( $post->post_password, $hash ); 610 607 } 611 608 -
trunk/wp-login.php
r24317 r24466 408 408 409 409 case 'postpass' : 410 if ( empty( $wp_hasher ) ) { 411 require_once( ABSPATH . 'wp-includes/class-phpass.php' ); 412 // By default, use the portable hash from phpass 413 $wp_hasher = new PasswordHash(8, true); 414 } 410 require_once ABSPATH . 'wp-includes/class-phpass.php'; 411 $hasher = new PasswordHash( 8, true ); 415 412 416 413 // 10 days 417 setcookie( 'wp-postpass_' . COOKIEHASH, $ wp_hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH );414 setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH ); 418 415 419 416 wp_safe_redirect( wp_get_referer() );
Note: See TracChangeset
for help on using the changeset viewer.