Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r12130 r12286  
    9292            die;
    9393         } elseif ( 2 == $_GET['test'] ) {
     94            if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
     95                die('-1');
    9496            if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
    9597                header('Content-Encoding: deflate');
     
    218220        if ( 'spam' == $status )
    219221            die( (string) time() );
    220         $r = wp_set_comment_status( $comment->comment_ID, 'spam' );
     222        $r = wp_spam_comment( $comment->comment_ID );
     223    } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
     224        if ( 'spam' != $status )
     225            die( (string) time() );
     226        $r = wp_unspam_comment( $comment->comment_ID );
    221227    } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
    222228        $r = wp_delete_comment( $comment->comment_ID );
     
    12071213
    12081214    $searchand = $search = '';
    1209     foreach( (array) $search_terms as $term) {
     1215    foreach ( (array) $search_terms as $term ) {
    12101216        $term = addslashes_gpc($term);
    12111217        $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
     
    12161222        $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
    12171223
    1218     $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" );
     1224    $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
    12191225
    12201226    if ( ! $posts )
    12211227        exit( __('No posts found.') );
    12221228
    1223     $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Time').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
     1229    $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
    12241230    foreach ( $posts as $post ) {
    12251231
     
    12361242                break;
    12371243            case 'draft' :
    1238                 $stat = __('Unpublished');
     1244                $stat = __('Draft');
    12391245                break;
    12401246        }
Note: See TracChangeset for help on using the changeset viewer.