Make WordPress Core

Ticket #17737: 17737.2.patch

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

     
    17311731
    17321732                // Category stuff
    17331733                if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular && $this->query_vars_changed ) {
    1734                         $q['cat'] = ''.urldecode($q['cat']).'';
    1735                         $q['cat'] = addslashes_gpc($q['cat']);
    1736                         $cat_array = preg_split('/[,\s]+/', $q['cat']);
     1734                        $q['cat'] = urldecode( (string) $q['cat'] );
     1735                        $q['cat'] = addslashes_gpc( $q['cat'] );
     1736                        $cat_array = preg_split( '/[,\s]+/', $q['cat'] );
    17371737                        $q['cat'] = '';
    17381738                        $req_cats = array();
    17391739                        foreach ( (array) $cat_array as $cat ) {
     
    22732273                if ( empty($q['author']) || ($q['author'] == '0') ) {
    22742274                        $whichauthor = '';
    22752275                } else {
    2276                         $q['author'] = (string)urldecode($q['author']);
    2277                         $q['author'] = addslashes_gpc($q['author']);
     2276                        $q['author'] = urldecode( (string) $q['author'] );
     2277                        $q['author'] = addslashes_gpc( $q['author'] );
    22782278                        if ( strpos($q['author'], '-') !== false ) {
    22792279                                $eq = '!=';
    22802280                                $andor = 'AND';
     
    23352335                                $allowed_keys[] = 'meta_value';
    23362336                                $allowed_keys[] = 'meta_value_num';
    23372337                        }
    2338                         $q['orderby'] = urldecode($q['orderby']);
    2339                         $q['orderby'] = addslashes_gpc($q['orderby']);
     2338                        $q['orderby'] = urldecode( (string) $q['orderby'] );
     2339                        $q['orderby'] = addslashes_gpc( $q['orderby'] );
    23402340
    23412341                        $orderby_array = array();
    23422342                        foreach ( explode( ' ', $q['orderby'] ) as $i => $orderby ) {