Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 20892)
+++ wp-includes/link-template.php	(working copy)
@@ -1873,8 +1873,8 @@
 
 	if ( 'relative' == $scheme )
 		$url = preg_replace( '#^.+://[^/]*#', '', $url );
-	elseif ( 'http' != $scheme )
-		$url = str_replace( 'http://', "$scheme://", $url );
+	else
+		$url = str_replace( array( 'http://', 'https://' ), "$scheme://", $url );
 
 	if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
 		$url .= '/' . ltrim( $path, '/' );
@@ -1938,8 +1938,8 @@
 
 	if ( 'relative' == $scheme )
 		$url = preg_replace( '#^.+://[^/]*#', '', $url );
-	elseif ( 'http' != $scheme )
-		$url = str_replace( 'http://', "{$scheme}://", $url );
+	else
+		$url = str_replace( array( 'http://', 'https://' ), "$scheme://", $url );
 
 	if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
 		$url .= '/' . ltrim( $path, '/' );
