Make WordPress Core

Ticket #33074: 33074.diff

File 33074.diff, 3.1 KB (added by wonderboymusic, 9 years ago)
  • src/wp-includes/class-wp.php

     
    1515         * @access public
    1616         * @var array
    1717         */
    18         public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
     18        public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'title');
    1919
    2020        /**
    2121         * Private query variables.
  • src/wp-includes/query.php

     
    14251425                        , 'preview'
    14261426                        , 's'
    14271427                        , 'sentence'
     1428                        , 'title'
    14281429                        , 'fields'
    14291430                        , 'menu_order'
    14301431                );
     
    15441545         *                                                 true. Note: a string of comma-separated IDs will NOT work.
    15451546         *     @type array        $tax_query               An associative array of WP_Tax_Query arguments.
    15461547         *                                                 {@see WP_Tax_Query->queries}
     1548         *     @type string       $title                   Post title.
    15471549         *     @type bool         $update_post_meta_cache  Whether to update the post meta cache. Default true.
    15481550         *     @type bool         $update_post_term_cache  Whether to update the post term cache. Default true.
    15491551         *     @type int          $w                       The week number of the year. Default empty. Accepts numbers 0-53.
     
    15761578                $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
    15771579                $qv['author'] = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers
    15781580                $qv['pagename'] = trim( $qv['pagename'] );
     1581                $qv['title'] = trim( $qv['title'] );
    15791582                $qv['name'] = trim( $qv['name'] );
    15801583                if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']);
    15811584                if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
     
    26052608                        unset($ptype_obj);
    26062609                }
    26072610
     2611                if ( '' !== $q['title'] ) {
     2612                        $title = sanitize_title_for_query( $q['title'] );
     2613                        $where .= $wpdb->prepare( " AND $wpdb->posts.post_title = %s", $title );
     2614                }
     2615
    26082616                // Parameters related to 'post_name'.
    26092617                if ( '' != $q['name'] ) {
    26102618                        $q['name'] = sanitize_title_for_query( $q['name'] );