WordPress.org

Make WordPress Core

Changeset 16155


Ignore:
Timestamp:
11/02/2010 05:28:28 PM (8 years ago)
Author:
scribu
Message:

Use wp_basename() in WP_Query too. See #11887

File:
1 edited

Legend:

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

    r16143 r16155  
    14821482
    14831483                    if ( $t->rewrite['hierarchical'] ) {
    1484                         $q[$t->query_var] = $this->_qv_basename( $q[$t->query_var] );
     1484                        $q[$t->query_var] = wp_basename( $q[$t->query_var] );
    14851485                    }
    14861486
     
    18111811            $page_for_posts = get_option('page_for_posts');
    18121812            if  ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
    1813                 $q['pagename'] = sanitize_title_for_query( $this->_qv_basename( $q['pagename'] ) );
     1813                $q['pagename'] = sanitize_title_for_query( wp_basename( $q['pagename'] ) );
    18141814                $q['name'] = $q['pagename'];
    18151815                $where .= " AND ($wpdb->posts.ID = '$reqpage')";
     
    18231823            }
    18241824        } elseif ( '' != $q['attachment'] ) {
    1825             $q['attachment'] = sanitize_title_for_query( $this->_qv_basename( $q['attachment'] ) );
     1825            $q['attachment'] = sanitize_title_for_query( wp_basename( $q['attachment'] ) );
    18261826            $q['name'] = $q['attachment'];
    18271827            $where .= " AND $wpdb->posts.post_name = '" . $q['attachment'] . "'";
     
    31263126        return (bool) $this->is_404;
    31273127    }
    3128 
    3129     /**
    3130      * i18n friendly way to get the last segment in a path
    3131      *
    3132      * @since 3.1.0
    3133      * @access private
    3134      *
    3135      * @param string $path The path
    3136      * @return string
    3137      */
    3138     function _qv_basename( $path ) {
    3139         return basename( str_replace( '%2F', '/', urlencode( urldecode( $path ) ) ) );
    3140     }
    31413128}
    31423129
Note: See TracChangeset for help on using the changeset viewer.