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:
parent
1705487213
commit
8daebf1b28
@ -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’t have the right to delete <strong>'.$authordata->user_nickname.'</strong>’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'] != "") {
|
||||
|
Loading…
Reference in New Issue
Block a user