WordPress.org

Make WordPress Core

Changeset 7877


Ignore:
Timestamp:
05/02/2008 05:28:36 PM (13 years ago)
Author:
ryan
Message:

Fix post name check prepare. Props westi. see #6894 for 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-includes/post.php

    r7753 r7877  
    12861286            do {
    12871287                $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix";
    1288                 // expected_slashed ($alt_post_name, $post_name, $post_type)
    1289                 $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != %d AND post_parent = %d LIMIT 1", $post_ID, $post_parent));
     1288                $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_type, $post_ID, $post_parent));
    12901289                $suffix++;
    12911290            } while ($post_name_check);
Note: See TracChangeset for help on using the changeset viewer.