]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/edit-comments.php
WordPress 4.1.2-scripts
[autoinstalls/wordpress.git] / wp-admin / edit-comments.php
index 100d02302583664abff924259a2a94095b8ff5b6..d1bf2b568dac4f7b929617af045b3a74d7cb823a 100644 (file)
@@ -7,9 +7,9 @@
  */
 
 /** WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( dirname( __FILE__ ) . '/admin.php' );
 if ( !current_user_can('edit_posts') )
-       wp_die(__('Cheatin’ uh?'));
+       wp_die( __( 'Cheatin’ uh?' ), 403 );
 
 $wp_list_table = _get_list_table('WP_Comments_List_Table');
 $pagenum = $wp_list_table->get_pagenum();
@@ -20,9 +20,9 @@ if ( $doaction ) {
        check_admin_referer( 'bulk-comments' );
 
        if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
-               $comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
-               $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
-               $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
+               $comment_status = wp_unslash( $_REQUEST['comment_status'] );
+               $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] );
+               $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
                $doaction = 'delete';
        } elseif ( isset( $_REQUEST['delete_comments'] ) ) {
                $comment_ids = $_REQUEST['delete_comments'];
@@ -95,7 +95,7 @@ if ( $doaction ) {
        wp_safe_redirect( $redirect_to );
        exit;
 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
-        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
+        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
         exit;
 }
 
@@ -105,7 +105,7 @@ wp_enqueue_script('admin-comments');
 enqueue_comment_hotkeys_js();
 
 if ( $post_id )
-       $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
+       $title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
 else
        $title = __('Comments');
 
@@ -121,10 +121,10 @@ get_current_screen()->add_help_tab( array(
 'id'           => 'moderating-comments',
 'title'                => __('Moderating Comments'),
 'content'      =>
-               '<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
+               '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
                '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
                '<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says &#8220;Submitted on,&#8221; followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
-               '<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
+               '<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
                '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
 ) );
 
@@ -133,27 +133,26 @@ get_current_screen()->set_help_sidebar(
        '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
        '<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
        '<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
-       '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
+       '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
 );
 
-require_once('./admin-header.php');
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
 ?>
 
 <div class="wrap">
-<?php screen_icon(); ?>
 <h2><?php
 if ( $post_id )
-       echo sprintf(__('Comments on &#8220;%s&#8221;'),
-               sprintf('<a href="%s">%s</a>',
-                       get_edit_post_link($post_id),
-                       wp_html_excerpt(_draft_or_post_title($post_id), 50)
+       echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
+               sprintf( '<a href="%s">%s</a>',
+                       get_edit_post_link( $post_id ),
+                       wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )
                )
        );
 else
        echo __('Comments');
 
 if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
-       printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
+       echo '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) ) . '</span>'; ?>
 </h2>
 
 <?php
@@ -252,4 +251,4 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
 <?php
 wp_comment_reply('-1', true, 'detail');
 wp_comment_trashnotice();
-include('./admin-footer.php'); ?>
+include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>