### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
|
| 1977 | 1977 | } elseif ( in_array($post_type, $hierarchical_post_types) ) { |
| 1978 | 1978 | // Page slugs must be unique within their own trees. Pages are in a |
| 1979 | 1979 | // separate namespace than posts so page slugs are allowed to overlap post slugs. |
| 1980 | | $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", esc_sql($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; |
| | 1980 | // FIXME $wpdb->prepare usage for $hierarchical_post_types as well |
| | 1981 | $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", array_map('esc_sql', $hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; |
| 1981 | 1982 | $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID, $post_parent)); |
| 1982 | 1983 | |
| 1983 | 1984 | if ( $post_name_check || in_array($slug, $feeds) ) { |