WordPress.org

Make WordPress Core

Ticket #6894: 6894.diff

File 6894.diff, 1007 bytes (added by westi, 13 years ago)

A patch for one issue (probably of many)

  • C:/xampp/htdocs/wordpress/trunk/wp-includes/post.php

     
    12851285                        $suffix = 2;
    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);
    12921291                        $post_name = $alt_post_name;