X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..4f4e083f6f77639c41e2b1ddb200de8e34301cee:/wp-admin/edit-comments.php diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 43eecffc..7df02103 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -83,20 +83,22 @@ else require_once('admin-header.php'); -$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']); +$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); -$comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : ''; +$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all'; +if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) ) + $comment_status = 'all'; -$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : ''; +$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : ''; $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; -$search = attribute_escape( $search_dirty ); ?> +$search = esc_attr( $search_dirty ); ?>
-

' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( wp_specialchars( stripslashes( $_GET['s'] ) ), 50 ) ) . '' ); ?> + printf( '' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_GET['s'] ) ), 50 ) ) . '' ); ?>

'; if ( $approved > 0 ) { - printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved ); + printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); echo '
'; } if ( $deleted > 0 ) { - printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); + printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); echo '
'; } if ( $spam > 0 ) { - printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); + printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); echo '
'; } @@ -136,34 +138,31 @@ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments //, number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), //, number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") $stati = array( - 'all' => __ngettext_noop('All', 'All'), // singular not used - 'moderated' => __ngettext_noop('Pending (%s)', 'Pending (%s)'), - 'approved' => __ngettext_noop('Approved', 'Approved'), // singular not used - 'spam' => __ngettext_noop('Spam (%s)', 'Spam (%s)') + 'all' => _n_noop('All', 'All'), // singular not used + 'moderated' => _n_noop('Pending (%s)', 'Pending (%s)'), + 'approved' => _n_noop('Approved', 'Approved'), // singular not used + 'spam' => _n_noop('Spam (%s)', 'Spam (%s)') ); -$class = ( '' === $comment_status ) ? ' class="current"' : ''; -// $status_links[] = "

  • " . __( 'All' ) . ''; $link = 'edit-comments.php'; if ( !empty($comment_type) && 'all' != $comment_type ) $link = add_query_arg( 'comment_type', $comment_type, $link ); foreach ( $stati as $status => $label ) { $class = ''; - if ( str_replace( 'all', '', $status ) == $comment_status ) + if ( $status == $comment_status ) $class = ' class="current"'; if ( !isset( $num_comments->$status ) ) $num_comments->$status = 10; - if ( 'all' != $status ) - $link = add_query_arg( 'comment_status', $status, $link ); + $link = add_query_arg( 'comment_status', $status, $link ); if ( $post_id ) $link = add_query_arg( 'p', absint( $post_id ), $link ); /* // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark if ( !empty( $_GET['s'] ) ) - $link = add_query_arg( 's', attribute_escape( stripslashes( $_GET['s'] ) ), $link ); + $link = add_query_arg( 's', esc_attr( stripslashes( $_GET['s'] ) ), $link ); */ $status_links[] = "
  • " . sprintf( - __ngettext( $label[0], $label[1], $num_comments->$status ), + _n( $label[0], $label[1], $num_comments->$status ), number_format_i18n( $num_comments->$status ) ) . ''; } @@ -176,13 +175,16 @@ unset($status_links); - + - + - - + +
    @@ -230,18 +232,21 @@ $page_links = paginate_links( array(
    ' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( $start + 1 ), number_format_i18n( min( $page * $comments_per_page, $total ) ), - number_format_i18n( $total ), + '' . number_format_i18n( $total ) . '', $page_links ); echo $page_links_text; ?>
    + + +
    - + -\n"; ?> - + - + - + @@ -326,10 +330,10 @@ if ( $page_links )
    - + - +
    @@ -351,18 +355,19 @@ if ( $page_links )
    - +

    @@ -373,21 +378,6 @@ if ( $page_links )
    - -