Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(Revision 35831)
+++ wp-includes/functions.php	(Arbeitskopie)
@@ -1876,6 +1876,11 @@
 			$url = trailingslashit( $siteurl ) . 'files';
 		}
 	}
+	
+	// On SSL front-end, URLs should be HTTPS
+	if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {
+		$url = set_url_scheme( $url );
+	}	
 
 	$basedir = $dir;
 	$baseurl = $url;
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(Revision 35831)
+++ wp-includes/post.php	(Arbeitskopie)
@@ -4895,11 +4895,6 @@
 		$url = get_the_guid( $post->ID );
 	}
 
-	// On SSL front-end, URLs should be HTTPS.
-	if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {
-		$url = set_url_scheme( $url );
-	}
-
 	/**
 	 * Filter the attachment URL.
 	 *
