Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 15723)
+++ wp-includes/link-template.php	(working copy)
@@ -271,11 +276,15 @@
 	else
 		$post = &get_post($id);
 
+	$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
+
 	$link = $wp_rewrite->get_page_permastruct();
+		
+	if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {	
+		if ( ! $leavename ) {
+			$link = str_replace('%pagename%', get_page_uri($id), $link);
+		}
 
-	if ( '' != $link && ( ( isset($post->post_status) && 'draft' != $post->post_status && 'pending' != $post->post_status ) || $sample ) ) {
-		if ( ! $leavename )
-			$link = str_replace('%pagename%', get_page_uri($id), $link);
 		$link = home_url($link);
 		$link = user_trailingslashit($link, 'page');
 	} else {
