Ticket #21779: 21779.2.patch
File 21779.2.patch, 1.7 KB (added by , 13 years ago) |
---|
-
wp-includes/query.php
1734 1734 if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular && $this->query_vars_changed ) { 1735 1735 $q['cat'] = ''.urldecode($q['cat']).''; 1736 1736 $q['cat'] = addslashes_gpc($q['cat']); 1737 $cat_array = preg_split('/[,\s]+/',$q['cat']);1737 $cat_array = wp_parse_id_list($q['cat']); 1738 1738 $q['cat'] = ''; 1739 1739 $req_cats = array(); 1740 1740 foreach ( (array) $cat_array as $cat ) { … … 1787 1787 // Tag stuff 1788 1788 if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) { 1789 1789 if ( strpos($q['tag'], ',') !== false ) { 1790 $tags = preg_split('/[,\ s]+/', $q['tag']);1790 $tags = preg_split('/[,\r\n\t ]+/', $q['tag']); 1791 1791 foreach ( (array) $tags as $tag ) { 1792 1792 $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); 1793 1793 $q['tag_slug__in'][] = $tag; 1794 1794 } 1795 } else if ( preg_match('/[+\ s]+/', $q['tag']) || !empty($q['cat']) ) {1796 $tags = preg_split('/[+\ s]+/', $q['tag']);1795 } else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) { 1796 $tags = preg_split('/[+\r\n\t ]+/', $q['tag']); 1797 1797 foreach ( (array) $tags as $tag ) { 1798 1798 $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); 1799 1799 $q['tag_slug__and'][] = $tag; … … 2290 2290 $eq = '='; 2291 2291 $andor = 'OR'; 2292 2292 } 2293 $author_array = preg_split('/[,\s]+/',$q['author']);2293 $author_array = wp_parse_id_list($q['author']); 2294 2294 $_author_array = array(); 2295 2295 foreach ( $author_array as $key => $_author ) 2296 2296 $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . absint($_author);