WordPress.org

Make WordPress Core

Ticket #2055: 2055.diff

File 2055.diff, 1.2 KB (added by Shindakun, 8 years ago)

2055 diff

  • wp-includes/pluggable-functions.php

     
    287287        setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); 
    288288        setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 
    289289        setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 
     290        setcookie('wp-postpass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH); 
    290291} 
    291292endif; 
    292293 
  • wp-includes/template-functions-post.php

     
    7070                        $output = get_the_password_form(); 
    7171                        return $output; 
    7272                } 
     73                if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) == $post->post_password ) {      // and it does match the cookie 
     74                        $site = get_settings('siteurl'); 
     75                        $output = '<br /><a href="' . $site .'/wp-login.php?action=logout">Delete post password cookie!</a><br /><br />'; 
     76                } 
    7377        } 
    7478 
    7579        if ( $more_file != '' )