WordPress.org

Make WordPress Core

Ticket #35601: 35601-2.diff

File 35601-2.diff, 906 bytes (added by birgire, 4 years ago)

Changed ! empty to isset and removed the right most trailing spaces after %s.

  • src/wp-includes/query.php

     
    30443044                        $where .= sprintf( " AND $wpdb->posts.post_password %s ''", $q['has_password'] ? '!=' : '=' );
    30453045                }
    30463046
    3047                 if ( ! empty( $q['comment_status'] ) ) {
    3048                         $where .= $wpdb->prepare( " AND $wpdb->posts.comment_status = %s ", $q['comment_status'] );
     3047                if ( isset( $q['comment_status'] ) ) {
     3048                        $where .= $wpdb->prepare( " AND $wpdb->posts.comment_status = %s", $q['comment_status'] );
    30493049                }
    30503050
    3051                 if ( ! empty( $q['ping_status'] ) ) {
    3052                         $where .= $wpdb->prepare( " AND $wpdb->posts.ping_status = %s ", $q['ping_status'] );
     3051                if ( isset( $q['ping_status'] ) ) {
     3052                        $where .= $wpdb->prepare( " AND $wpdb->posts.ping_status = %s", $q['ping_status'] );
    30533053                }
    30543054
    30553055                if ( 'any' == $post_type ) {