Ticket #16829: 16829.patch
File 16829.patch, 1.4 KB (added by , 13 years ago) |
---|
-
wp-includes/meta.php
708 708 709 709 foreach ( $this->queries as $k => $q ) { 710 710 $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : ''; 711 $meta_compare = isset( $q['compare'] ) ? strtoupper( $q['compare'] ) : '=';712 711 $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR'; 713 712 714 if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )715 $meta_compare = '=';716 717 713 if ( 'NUMERIC' == $meta_type ) 718 714 $meta_type = 'SIGNED'; 719 715 elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) ) … … 739 735 740 736 $meta_value = $q['value']; 741 737 738 $meta_compare = is_array( $meta_value ) ? 'IN' : '='; 739 if ( isset( $q['compare'] ) ) 740 $meta_compare = strtoupper( $q['compare'] ); 741 742 if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) 743 $meta_compare = '='; 744 742 745 if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) { 743 746 if ( ! is_array( $meta_value ) ) 744 747 $meta_value = preg_split( '/[,\s]+/', $meta_value );