[wp-trac] [WordPress Trac] #15433: Don't use 'name' query var if 'p' is already set

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 15 13:31:51 UTC 2010


#15433: Don't use 'name' query var if 'p' is already set
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Query         |     Version:     
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------
 Martin Lazarov (in wp-hackers):

 {{{
 Hi all,
 may be it's good idea to replace this in wp-includes/query.php:1759
 if ( '' != $q['name'] ) {

 width this:

 if ( '' != $q['name'] && !$q['p']) {

 This way the query will not contains post_name='...' if there is post
 ID passed. This will make query faster, because it will use only
 wp_posts primary key instead of making query by index and table scan.


 End the bug that i found is:
 some months ago i installed fresh wordpress on the server that doesn't
 have php mb_string functions, so the function
 sanitize_title_with_dashes (wp-includes/formatting.php:814) just
 doesn't do str to lower title values. But week ago i installed the mb
 string library for php and the old slugs stop working. That's because
 this code (part of wp-includes/formatting.php:814)  now works:

 if (function_exists('mb_strtolower')) {
        $title = mb_strtolower($title, 'UTF-8');
 }

 Adding the patch at the top of this mail solves the problem for me.
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15433>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list