Ticket #2615: mailapprovecomment.diff
| File mailapprovecomment.diff, 3.9 KB (added by , 20 years ago) |
|---|
-
wp-includes/functions-formatting.php
98 98 99 99 function wp_specialchars( $text, $quotes = 0 ) { 100 100 // Like htmlspecialchars except don't double-encode HTML entities 101 $text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/', '&$1', $text); -101 $text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/', '&$1', $text); 102 102 $text = str_replace('<', '<', $text); 103 103 $text = str_replace('>', '>', $text); 104 104 if ( 'double' === $quotes ) { -
wp-admin/comment.php
41 41 break; 42 42 43 43 case 'confirmdeletecomment': 44 case 'mailapprovecomment': 44 45 45 46 require_once('./admin-header.php'); 46 47 47 48 $comment = (int) $_GET['comment']; 48 49 $p = (int) $_GET['p']; 50 $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; 49 51 50 52 if ( ! $comment = get_comment($comment) ) 51 53 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 52 54 53 55 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 54 die( __('You are not allowed to delete comments on this post.') );56 die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 55 57 56 58 echo "<div class='wrap'>\n"; 57 59 if ( 'spam' == $_GET['delete_type'] ) 58 60 echo "<p>" . __('<strong>Caution:</strong> You are about to mark the following comment as spam:') . "</p>\n"; 59 else 61 elseif ( 'confirmdeletecomment' == $action ) 60 62 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 63 else 64 echo "<p>" . __('<strong>Caution:</strong> You are about to approve the following comment:') . "</p>\n"; 61 65 echo "<table border='0'>\n"; 62 66 echo "<tr><td>" . __('Author:') . "</td><td>$comment->comment_author</td></tr>\n"; 63 67 echo "<tr><td>" . __('E-mail:') . "</td><td>$comment->comment_author_email</td></tr>\n"; … … 67 71 echo "<p>" . __('Are you sure you want to do that?') . "</p>\n"; 68 72 69 73 echo "<form action='".get_settings('siteurl')."/wp-admin/comment.php' method='get'>\n"; 70 echo "<input type='hidden' name='action' value=' deletecomment' />\n";74 echo "<input type='hidden' name='action' value='$formaction' />\n"; 71 75 if ( 'spam' == $_GET['delete_type'] ) 72 76 echo "<input type='hidden' name='delete_type' value='spam' />\n"; 73 77 echo "<input type='hidden' name='p' value='$p' />\n"; … … 142 146 exit(); 143 147 break; 144 148 145 case 'mailapprovecomment':146 147 $comment = (int) $_GET['comment'];148 149 if ( ! $comment = get_comment($comment) )150 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));151 152 if ( !current_user_can('edit_post', $comment->comment_post_ID) )153 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );154 155 if ('1' != $comment->comment_approved) {156 wp_set_comment_status($comment->comment_ID, 'approve');157 if (true == get_option('comments_notify'))158 wp_notify_postauthor($comment->comment_ID);159 }160 161 header('Location: ' . get_option('siteurl') . '/wp-admin/moderation.php?approved=1');162 exit();163 break;164 165 149 case 'approvecomment': 166 150 167 151 check_admin_referer(); -
wp-admin/edit.php
249 249 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 250 250 if ($comments) { 251 251 ?> 252 <h3 ><?php _e('Comments') ?></h3>252 <h3 id="comments"><?php _e('Comments') ?></h3> 253 253 <ol id="the-list"> 254 254 <?php 255 255 $i = 0;