nonce approve/delete comment confirmations. #2678

git-svn-id: https://develop.svn.wordpress.org/trunk@3764 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-05-05 09:09:13 +00:00
parent 8cf29e9e4d
commit 51ce82e5b9
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,8 @@ case 'mailapprovecomment':
$comment = (int) $_GET['comment'];
$p = (int) $_GET['p'];
$formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment';
$nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment' : 'approve-comment';
$nonce_action .= $comment;
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
@ -74,6 +76,7 @@ case 'mailapprovecomment':
echo "<p>" . __('Are you sure you want to do that?') . "</p>\n";
echo "<form action='".get_settings('siteurl')."/wp-admin/comment.php' method='get'>\n";
wp_nonce_field($nonce_action);
echo "<input type='hidden' name='action' value='$formaction' />\n";
if ( 'spam' == $_GET['delete_type'] )
echo "<input type='hidden' name='delete_type' value='spam' />\n";