diff --git a/wp-content/themes/classic/comments-popup.php b/wp-content/themes/classic/comments-popup.php index 4e0a6057e..b28156436 100644 --- a/wp-content/themes/classic/comments-popup.php +++ b/wp-content/themes/classic/comments-popup.php @@ -33,7 +33,7 @@ $commenter = wp_get_current_commenter(); extract($commenter); $comments = get_approved_comments($id); $commentstatus = get_post($id); -if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie +if ( post_password_required($commentstatus) ) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?> diff --git a/wp-content/themes/classic/comments.php b/wp-content/themes/classic/comments.php index 4f92f65f7..dc995776f 100644 --- a/wp-content/themes/classic/comments.php +++ b/wp-content/themes/classic/comments.php @@ -1,4 +1,4 @@ -post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?> +

diff --git a/wp-content/themes/default/comments-popup.php b/wp-content/themes/default/comments-popup.php index a57ff21ce..5f739208f 100644 --- a/wp-content/themes/default/comments-popup.php +++ b/wp-content/themes/default/comments-popup.php @@ -33,7 +33,7 @@ $commenter = wp_get_current_commenter(); extract($commenter); $comments = get_approved_comments($id); $post = get_post($id); -if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie +if ( post_password_required($post) ) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?> diff --git a/wp-content/themes/default/comments.php b/wp-content/themes/default/comments.php index 50c594067..8a70c2d9c 100644 --- a/wp-content/themes/default/comments.php +++ b/wp-content/themes/default/comments.php @@ -2,15 +2,10 @@ if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); - if (!empty($post->post_password)) { // if there's a password - if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie - ?> - -

This post is password protected. Enter the password to view comments.

- - +

This post is password protected. Enter the password to view comments.

+ post_password) ) { // if there's a password - if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie - echo __('Enter your password to view comments'); - return; - } + if ( post_password_required() ) { + echo __('Enter your password to view comments'); + return; } echo '