diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-21 10:47:51 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-21 10:47:51 +0000 |
commit | 659852f4d4a6da8a8147d4fe73cd55a4e83d2264 (patch) | |
tree | b7944d764b51e9789f0cd7f061512fa9c085d807 /wp-includes/post.php | |
parent | a194fea75f7340d53134ff1ecfa5969b03735576 (diff) | |
download | wordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.tar.gz wordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.tar.xz wordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.zip |
WP Merge to rev 4201
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@763 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/post.php')
-rw-r--r-- | wp-includes/post.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wp-includes/post.php b/wp-includes/post.php index 468ed37..1968714 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -591,13 +591,13 @@ function wp_insert_post($postarr = array()) { if ( 'draft' != $post_status ) { $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); - if ($post_name_check) { + if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) { $suffix = 2; - while ($post_name_check) { + do { $alt_post_name = $post_name . "-$suffix"; $post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1"); $suffix++; - } + } while ($post_name_check); $post_name = $alt_post_name; } } |