Ticket #24093: 24093.1.patch
File 24093.1.patch, 1.0 KB (added by , 11 years ago) |
---|
-
wp-includes/meta.php
807 807 continue; 808 808 } 809 809 810 $join[$i] = "INNER JOIN $meta_table";811 $join[$i] .= $i ? " AS $alias" : '';812 $join[$i] .= " ON ($primary_table.$primary_id_column = $alias.$meta_id_column)";813 814 810 $where[$k] = ''; 815 811 if ( !empty( $meta_key ) ) 816 812 $where[$k] = $wpdb->prepare( "$alias.meta_key = %s", $meta_key ); … … 848 844 if ( ! empty( $where[$k] ) ) 849 845 $where[$k] .= ' AND '; 850 846 851 $where[$k] = ' (' . $where[$k] . $wpdb->prepare( "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string})", $meta_value );847 $where[$k] = ' ' . $primary_table . '.' . $primary_id_column . ' IN (SELECT ' . $meta_id_column . ' FROM ' . $alias . ' WHERE ' . $where[$k] . $wpdb->prepare( "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string})", $meta_value ); 852 848 } 853 849 854 850 $where = array_filter( $where );