Make WordPress Core


Ignore:
Timestamp:
10/02/2007 06:45:47 PM (18 years ago)
Author:
markjaquith
Message:

prepare() for wp-includes/ link-template.php, post.php, general-template.php, pluggable.php, functions.php. see #4553

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r6148 r6180  
    209209    if ( !empty($author_name) ) {
    210210        // We do a direct query here because we don't cache by nicename.
    211         $title = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_nicename = '$author_name'");
     211        $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name));
    212212    }
    213213
     
    256256    if ( intval($p) || '' != $name ) {
    257257        if ( !$p )
    258             $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'");
     258            $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name));
    259259        $post = & get_post($p);
    260260        $title = $post->post_title;
     
    364364
    365365    if ( '' != $limit ) {
    366         $limit = (int) $limit;
     366        $limit = abs(intval($limit));
    367367        $limit = ' LIMIT '.$limit;
    368368    }
Note: See TracChangeset for help on using the changeset viewer.