Make WordPress Core

Ticket #4721: 4721.diff

File 4721.diff, 4.3 KB (added by Nazgul, 19 years ago)
  • wp-content/themes/classic/comments-popup.php

     
    3434$comments = get_approved_comments($id);
    3535$commentstatus = get_post($id);
    3636if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) {  // and it doesn't match the cookie
    37         echo(get_the_password_form());
     37        echo(get_the_password_form($post->ID));
    3838} else { ?>
    3939
    4040<?php if ($comments) { ?>
  • wp-content/themes/default/comments-popup.php

     
    3434$comments = get_approved_comments($id);
    3535$post = get_post($id);
    3636if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
    37         echo(get_the_password_form());
     37        echo(get_the_password_form($post->ID));
    3838} else { ?>
    3939
    4040<?php if ($comments) { ?>
  • wp-includes/feed-atom-comments.php

     
    5151                <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated>
    5252                <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published>
    5353<?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?>
    54                 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content>
     54                <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form($comment_post->ID); ?>]]></content>
    5555<?php else : // post pass ?>
    5656                <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content>
    5757<?php endif; // post pass
  • wp-includes/feed-rss2-comments.php

     
    4343                <guid><?php comment_link() ?></guid>
    4444<?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?>
    4545                <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description>
    46                 <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
     46                <content:encoded><![CDATA[<?php echo get_the_password_form($comment_post->ID) ?>]]></content:encoded>
    4747<?php else : // post pass ?>
    4848                <description><?php comment_text_rss() ?></description>
    4949                <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
  • wp-includes/post-template.php

     
    6969
    7070        if ( !empty($post->post_password) ) { // if there's a password
    7171                if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) {      // and it doesn't match the cookie
    72                         $output = get_the_password_form();
     72                        $output = get_the_password_form($id);
    7373                        return $output;
    7474                }
    7575        }
     
    463463// Misc
    464464//
    465465
    466 function get_the_password_form() {
     466function get_the_password_form($id = 0) {
     467        $label = 'pwbox-'.(empty($id) ? rand() : $id);
    467468        $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    468469        <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
    469         <p><label>' . __("Password:") . ' <input name="post_password" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . __("Submit") . '" /></p>
     470        <p><label for="'.$label.'">' . __("Password:") . ' <input name="post_password" type="password" size="20" id="'.$label.'" /></label> <input type="submit" name="Submit" value="' . __("Submit") . '" /></p>
    470471        </form>
    471472        ';
    472473        return $output;