Make WordPress Core


Ignore:
Timestamp:
10/14/2004 05:00:51 AM (20 years ago)
Author:
saxmatt
Message:

Some code cleanup. Also double email fix care of Mark Jaquith.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r1787 r1793  
    11<?php
    2 /* <Edit> */
    3 
    42require_once('../wp-includes/wp-l10n.php');
    53
     
    655653case 'mailapprovecomment':
    656654
    657 $standalone = 0;
     655$standalone = 1;
    658656require_once('./admin-header.php');
    659657
     
    661659    die (__('Cheatin&#8217; uh?'));
    662660
    663 $comment = $_GET['comment'];
    664 $p = $_GET['p'];
     661$comment = (int) $_GET['comment'];
     662
    665663$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    666664
    667 wp_set_comment_status($comment, "approve");
    668 if (get_settings("comments_notify") == true) {
    669     wp_notify_postauthor($comment);
    670 }
    671 
    672 echo "<div class=\"wrap\">\n";
    673 echo "<p>" . __('Comment has been approved.') . "</p>\n";
    674 
    675 echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
    676 echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
    677 echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n";
    678 echo "<input type=\"submit\" value=\"" . __('Ok') . "\" />";
    679 echo "</form>\n";
    680 echo "</div>\n";
     665if ('1' != $commentdata['comment_approved']) {
     666    wp_set_comment_status($comment, 'approve');
     667    if (true == get_option('comments_notify'))
     668        wp_notify_postauthor($comment);
     669}
     670
     671header('Location: ' . get_option('siteurl') . '/wp-admin/moderation.php?approved=1');
    681672
    682673break;
Note: See TracChangeset for help on using the changeset viewer.