WordPress.org

Make WordPress Core

Changeset 20325


Ignore:
Timestamp:
03/30/12 13:08:12 (2 years ago)
Author:
nacin
Message:

Always pass a table alias to wp_post_mime_type_where(). Prevents ambiguous queries when adding joins later on. props benbalter, fixes #20193.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r20171 r20325  
    23122312        // MIME-Type stuff for attachment browsing 
    23132313 
    2314         if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] ) { 
    2315             $table_alias = $post_status_join ? $wpdb->posts : ''; 
    2316             $whichmimetype = wp_post_mime_type_where($q['post_mime_type'], $table_alias); 
    2317         } 
     2314        if ( isset( $q['post_mime_type'] ) && '' != $q['post_mime_type'] ) 
     2315            $whichmimetype = wp_post_mime_type_where( $q['post_mime_type'], $wpdb->posts ); 
    23182316 
    23192317        $where .= $search . $whichauthor . $whichmimetype; 
Note: See TracChangeset for help on using the changeset viewer.