Make WordPress Core

Ticket #21779: 21779.2.patch

File 21779.2.patch, 1.7 KB (added by SergeyBiryukov, 13 years ago)
  • wp-includes/query.php

     
    17341734                if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular && $this->query_vars_changed ) {
    17351735                        $q['cat'] = ''.urldecode($q['cat']).'';
    17361736                        $q['cat'] = addslashes_gpc($q['cat']);
    1737                         $cat_array = preg_split('/[,\s]+/', $q['cat']);
     1737                        $cat_array = wp_parse_id_list($q['cat']);
    17381738                        $q['cat'] = '';
    17391739                        $req_cats = array();
    17401740                        foreach ( (array) $cat_array as $cat ) {
     
    17871787                // Tag stuff
    17881788                if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) {
    17891789                        if ( strpos($q['tag'], ',') !== false ) {
    1790                                 $tags = preg_split('/[,\s]+/', $q['tag']);
     1790                                $tags = preg_split('/[,\r\n\t ]+/', $q['tag']);
    17911791                                foreach ( (array) $tags as $tag ) {
    17921792                                        $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
    17931793                                        $q['tag_slug__in'][] = $tag;
    17941794                                }
    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']);
    17971797                                foreach ( (array) $tags as $tag ) {
    17981798                                        $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
    17991799                                        $q['tag_slug__and'][] = $tag;
     
    22902290                                $eq = '=';
    22912291                                $andor = 'OR';
    22922292                        }
    2293                         $author_array = preg_split('/[,\s]+/', $q['author']);
     2293                        $author_array = wp_parse_id_list($q['author']);
    22942294                        $_author_array = array();
    22952295                        foreach ( $author_array as $key => $_author )
    22962296                                $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . absint($_author);