Make WordPress Core


Ignore:
Timestamp:
10/23/2010 12:55:55 PM (14 years ago)
Author:
scribu
Message:

Introduce sanitize_title_for_query(). See #9591

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r15923 r15929  
    17851785
    17861786        if ( '' != $q['name'] ) {
    1787             $q['name'] = sanitize_title( $q['name'] );
     1787            $q['name'] = sanitize_title_for_query( $q['name'] );
    17881788            $where .= " AND $wpdb->posts.post_name = '" . $q['name'] . "'";
    17891789        } elseif ( '' != $q['pagename'] ) {
     
    18131813            $page_for_posts = get_option('page_for_posts');
    18141814            if  ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
    1815                 $q['pagename'] = sanitize_title( $this->_qv_basename( $q['pagename'] ) );
     1815                $q['pagename'] = sanitize_title_for_query( $this->_qv_basename( $q['pagename'] ) );
    18161816                $q['name'] = $q['pagename'];
    18171817                $where .= " AND ($wpdb->posts.ID = '$reqpage')";
     
    18251825            }
    18261826        } elseif ( '' != $q['attachment'] ) {
    1827             $q['attachment'] = sanitize_title( $this->_qv_basename( $q['attachment'] ) );
     1827            $q['attachment'] = sanitize_title_for_query( $this->_qv_basename( $q['attachment'] ) );
    18281828            $q['name'] = $q['attachment'];
    18291829            $where .= " AND $wpdb->posts.post_name = '" . $q['attachment'] . "'";
     
    19581958                }
    19591959            }
    1960             $q['author_name'] = sanitize_title( $q['author_name'] );
     1960            $q['author_name'] = sanitize_title_for_query( $q['author_name'] );
    19611961            $q['author'] = get_user_by('slug', $q['author_name']);
    19621962            if ( $q['author'] )
Note: See TracChangeset for help on using the changeset viewer.