From 71502d6382f59e775109b70744236dc3a32408b6 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 4 Mar 2009 08:03:02 +0000 Subject: [PATCH] Syncronise the queries used for attachment slug uniqueness checking. Fixes #4396 props futurix and Nazgul. git-svn-id: https://develop.svn.wordpress.org/trunk@10693 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 0c83662929..14f4ecf8a9 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2381,7 +2381,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { while ($post_name_check) { $alt_post_name = $post_name . "-$suffix"; // expected_slashed ($alt_post_name, $post_name) - $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_status = 'inherit' AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_ID, $post_parent)); + $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_status = 'inherit' AND ID != %d LIMIT 1", $alt_post_name, $post_ID, $post_parent)); $suffix++; } $post_name = $alt_post_name;