Index: wp-admin/includes/file.php
===================================================================
--- wp-admin/includes/file.php	(revision 27910)
+++ wp-admin/includes/file.php	(working copy)
@@ -79,8 +79,8 @@
  * @return string Full filesystem path to the root of the WordPress installation
  */
 function get_home_path() {
-	$home = get_option( 'home' );
-	$siteurl = get_option( 'siteurl' );
+	$home = remove_url_scheme( get_option( 'home' ) );
+	$siteurl = remove_url_scheme( get_option( 'siteurl' ) );
 	if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
 		$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
 		$pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 27910)
+++ wp-includes/link-template.php	(working copy)
@@ -2332,6 +2332,23 @@
 }
 
 /**
+ * Remove the scheme from a URL
+ *
+ * @since 3.9.0
+ *
+ * @param string $url Absolute url that includes a scheme
+ * @return string $url URL without its scheme.
+ */
+function remove_url_scheme( $url ) {
+	$url = trim( $url );
+	if ( substr( $url, 0, 2 ) === '//' ) {
+		$url = 'http:' . $url;
+	}
+
+	return preg_replace( '#^\w+://#', '', $url );
+}
+
+/**
  * Get the URL to the user's dashboard.
  *
  * If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,
