From 5b7e0784b245e9250129ba935a73d16c139337de Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 14 Oct 2004 05:00:51 +0000 Subject: [PATCH] Some code cleanup. Also double email fix care of Mark Jaquith. git-svn-id: http://svn.automattic.com/wordpress/trunk@1793 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index c447f117f2..0a67f41413 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;