Ticket #11423: 11423.diff
| File 11423.diff, 1.5 KB (added by , 16 years ago) |
|---|
-
wp-includes/query.php
1986 1986 } 1987 1987 } 1988 1988 $q['author_name'] = sanitize_title($q['author_name']); 1989 $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'");1990 1989 $q['author'] = get_user_by('slug', $q['author_name']); 1991 1990 if ( $q['author'] ) 1992 1991 $q['author'] = $q['author']->ID; 1992 else 1993 $q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'"); 1993 1994 $whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')'; 1994 1995 } 1995 1996 -
wp-includes/general-template.php
458 458 $title = $title->display_name; 459 459 } 460 460 if ( !empty($author_name) ) { 461 // We do a direct query here because we don't cache by nicename. 462 $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name)); 461 if ( ( $user_id = wp_cache_get($author_name, 'userslugs') ) && ( $user = wp_cache_get($user_id, 'users') ) ) 462 $title = $user->display_name; 463 else 464 $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name)); 463 465 } 464 466 465 467 // If there's a month