diff --git a/wp-admin/post.php b/wp-admin/post.php index c447f117f..0a67f4141 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -1,6 +1,4 @@ */ - require_once('../wp-includes/wp-l10n.php'); function add_magic_quotes($array) { @@ -654,30 +652,23 @@ break; case 'mailapprovecomment': -$standalone = 0; +$standalone = 1; require_once('./admin-header.php'); if ($user_level == 0) die (__('Cheatin’ uh?')); -$comment = $_GET['comment']; -$p = $_GET['p']; +$comment = (int) $_GET['comment']; + $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); -wp_set_comment_status($comment, "approve"); -if (get_settings("comments_notify") == true) { - wp_notify_postauthor($comment); +if ('1' != $commentdata['comment_approved']) { + wp_set_comment_status($comment, 'approve'); + if (true == get_option('comments_notify')) + wp_notify_postauthor($comment); } -echo "
\n"; -echo "

" . __('Comment has been approved.') . "

\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo ""; -echo "
\n"; -echo "
\n"; +header('Location: ' . get_option('siteurl') . '/wp-admin/moderation.php?approved=1'); break;