Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/wp-includes/query.php

    r18047 r17805  
    16261626                }
    16271627
    1628                 if ( ! empty( $qv['post_status'] ) ) {
    1629                         if ( is_array( $qv['post_status'] ) )
    1630                                 $qv['post_status'] = array_map('sanitize_key', $qv['post_status']);
    1631                         else
    1632                                 $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
    1633                 }
     1628                if ( !empty($qv['post_status']) )
     1629                        $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
    16341630
    16351631                if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
    … …  
    23902386                }
    23912387
    2392                 if ( ! empty( $q['post_status'] ) ) {
     2388                if ( isset($q['post_status']) && '' != $q['post_status'] ) {
    23932389                        $statuswheres = array();
    2394                         $q_status = $q['post_status'];
    2395                         if ( ! is_array( $q_status ) )
    2396                                 $q_status = explode(',', $q_status);
     2390                        $q_status = explode(',', $q['post_status']);
    23972391                        $r_status = array();
    23982392                        $p_status = array();
    23992393                        $e_status = array();
    2400                         if ( in_array('any', $q_status) ) {
     2394                        if ( $q['post_status'] == 'any' ) {
    24012395                                foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
    24022396                                        $e_status[] = "$wpdb->posts.post_status <> '$status'";
Note: See TracChangeset for help on using the changeset viewer.