Make WordPress Core

Changeset 4866


Ignore:
Timestamp:
02/05/2007 09:29:39 PM (20 years ago)
Author:
ryan
Message:

Disambiguate queries. Props mhyk25. fixes #3747

File:
1 edited

Legend:

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

    r4754 r4866  
    795795                        $out_cats = substr($out_cats, 0, -2);
    796796                        if ( strlen($in_cats) > 0 )
    797                                 $in_cats = " AND category_id IN ($in_cats)";
     797                                $in_cats = " AND $wpdb->post2cat.category_id IN ($in_cats)";
    798798                        if ( strlen($out_cats) > 0 ) {
    799                                 $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id IN ($out_cats)");
     799                                $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)");
    800800                                if ( is_array($ids) && count($ids > 0) ) {
    801801                                        foreach ( $ids as $id )
    … …  
    804804                                }
    805805                                if ( strlen($out_posts) > 0 )
    806                                         $out_cats = " AND ID NOT IN ($out_posts)";
     806                                        $out_cats = " AND $wpdb->posts.ID NOT IN ($out_posts)";
    807807                                else
    808808                                        $out_cats = '';
Note: See TracChangeset for help on using the changeset viewer.