Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 21097)
+++ wp-includes/link-template.php	(working copy)
@@ -122,8 +122,9 @@
 			$cats = get_the_category($post->ID);
 			if ( $cats ) {
 				usort($cats, '_usort_terms_by_ID'); // order by ID
-				$category = $cats[0]->slug;
-				if ( $parent = $cats[0]->parent )
+				$category_object = get_term( apply_filters( 'post_link_category', $cats[0], $cats, $post ), 'category' );
+				$category = $category_object->slug;
+				if ( $parent = $category_object->parent )
 					$category = get_category_parents($parent, false, '/', true) . $category;
 			}
 			// show default category in permalinks, without
