Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 17128)
+++ wp-includes/link-template.php	(working copy)
@@ -1101,6 +1101,12 @@
 	if ( empty( $post ) )
 		return null;
 
+	if ( $in_same_cat ) {
+		$taxonomies = get_object_taxonomies($post);
+		if ( ! in_array('category', $taxonomies) )
+			$in_same_cat = false;
+	}
+
 	$current_post_date = $post->post_date;
 
 	$join = '';
