Ticket #17170: 17170.diff
File 17170.diff, 730 bytes (added by , 10 years ago) |
---|
-
src/wp-includes/post.php
3831 3831 } 3832 3832 } else { 3833 3833 // Post slugs must be unique across all posts. 3834 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %sAND ID != %d LIMIT 1";3834 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ( post_type = %s OR post_type = 'attachment' ) AND ID != %d LIMIT 1"; 3835 3835 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) ); 3836 3836 3837 3837 // Prevent new post slugs that could result in URLs that conflict with date archives.