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
This commit is contained in:
saxmatt 2004-10-14 05:00:51 +00:00
parent 3472b445a2
commit 5b7e0784b2

View File

@ -1,6 +1,4 @@
<?php <?php
/* <Edit> */
require_once('../wp-includes/wp-l10n.php'); require_once('../wp-includes/wp-l10n.php');
function add_magic_quotes($array) { function add_magic_quotes($array) {
@ -654,30 +652,23 @@ break;
case 'mailapprovecomment': case 'mailapprovecomment':
$standalone = 0; $standalone = 1;
require_once('./admin-header.php'); require_once('./admin-header.php');
if ($user_level == 0) if ($user_level == 0)
die (__('Cheatin&#8217; uh?')); die (__('Cheatin&#8217; uh?'));
$comment = $_GET['comment']; $comment = (int) $_GET['comment'];
$p = $_GET['p'];
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
wp_set_comment_status($comment, "approve"); if ('1' != $commentdata['comment_approved']) {
if (get_settings("comments_notify") == true) { wp_set_comment_status($comment, 'approve');
wp_notify_postauthor($comment); if (true == get_option('comments_notify'))
wp_notify_postauthor($comment);
} }
echo "<div class=\"wrap\">\n"; header('Location: ' . get_option('siteurl') . '/wp-admin/moderation.php?approved=1');
echo "<p>" . __('Comment has been approved.') . "</p>\n";
echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n";
echo "<input type=\"submit\" value=\"" . __('Ok') . "\" />";
echo "</form>\n";
echo "</div>\n";
break; break;