Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 18403)
+++ wp-includes/functions.php	(working copy)
@@ -3622,6 +3622,22 @@
 }
 
 /**
+ * Filter a url to have the correct protocol
+ *
+ * @since 3.3
+ * @param string $url, url to filter 
+ * @return string $url, filtered url
+ */
+function set_url_scheme($url) {
+	if ( is_ssl() ) {
+		$url = str_replace( 'http://', 'https://', $url ); 
+	} else {
+		$url = str_replace( 'https://', 'http://', $url ); 
+  }
+	return $url; 
+}
+
+/**
  * Whether SSL login should be forced.
  *
  * @since 2.6.0
