Changeset 3671
- Timestamp:
- 03/31/2006 08:32:30 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r3665 r3671 42 42 43 43 case 'confirmdeletecomment': 44 case 'mailapprovecomment': 44 45 45 46 require_once('./admin-header.php'); … … 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) ) … … 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"; 61 elseif ( 'confirmdeletecomment' == $action ) 62 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 59 63 else 60 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n";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"; … … 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"; … … 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 -
trunk/wp-admin/edit.php
r3660 r3671 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 -
trunk/wp-includes/functions-formatting.php
r3660 r3671 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);
Note: See TracChangeset
for help on using the changeset viewer.