Ticket #16824: 16824.diff
File 16824.diff, 1.5 KB (added by , 14 years ago) |
---|
-
wp-includes/query.php
1625 1625 $qv['post_type'] = sanitize_key($qv['post_type']); 1626 1626 } 1627 1627 1628 if ( !empty($qv['post_status']) ) 1629 $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); 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 } 1630 1634 1631 1635 if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) ) 1632 1636 $this->is_comment_feed = false; … … 2387 2391 $read_private_cap = 'read_private_' . $post_type_cap . 's'; 2388 2392 } 2389 2393 2390 if ( isset($q['post_status']) && '' != $q['post_status']) {2394 if ( ! empty( $q['post_status'] ) ) { 2391 2395 $statuswheres = array(); 2392 $q_status = explode(',', $q['post_status']); 2396 $q_status = $q['post_status']; 2397 if ( ! is_array( $q_status ) ) 2398 $q_status = preg_split('|[,\s]+|', $q_status); 2393 2399 $r_status = array(); 2394 2400 $p_status = array(); 2395 2401 $e_status = array(); 2396 if ( $q['post_status'] == 'any') {2402 if ( in_array('any', $q_status) ) { 2397 2403 foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status ) 2398 2404 $e_status[] = "$wpdb->posts.post_status <> '$status'"; 2399 2405 } else {