--- a/wp-includes/post.php        2011-02-02 03:19:34.000000000 +0100
+++ b/wp-includes/post.php        2011-02-02 03:19:34.000000000 +0100
@@ -3133,7 +3133,7 @@
        foreach ( (array) $page_paths as $pathdir )
                $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir);

-       $pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND (post_type = %s OR post_type = 'attachment')", $leaf_path, $post_type ));
+       $pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND post_type = %s", $leaf_path, $post_type ));

        if ( empty($pages) )
                return $null;
