Fix for comment deletion priileges.

Bug reported by Michael Renzmann


git-svn-id: https://develop.svn.wordpress.org/trunk@527 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mike Little 2003-11-06 00:34:41 +00:00
parent 1705487213
commit 8daebf1b28
1 changed files with 7 additions and 0 deletions

View File

@ -350,10 +350,17 @@ switch($action) {
if ($user_level == 0)
die ('Cheatin’ uh?');
$comment = $HTTP_GET_VARS['comment'];
$p = $HTTP_GET_VARS['p'];
$postdata = get_postdata($p) or die('Oops, no post with this ID. <a href="wp-post.php">Go back</a>!');
$commentdata = get_commentdata($comment) or die('Oops, no comment with this ID. <a href="wp-post.php">Go back</a>!');
$authordata = get_userdata($postdata['Author_ID']);
if ($user_level < $authordata->user_level)
die ('You don&#8217;t have the right to delete <strong>'.$authordata->user_nickname.'</strong>&#8217;s post comments. <a href="wp-post.php">Go back</a>!');
$result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_ID=$comment");
if($HTTP_SERVER_VARS['HTTP_REFERER'] != "") {