<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[21664] trunk: Use set_url_scheme().</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/21664">21664</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2012-08-30 13:33:00 +0000 (Thu, 30 Aug 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use set_url_scheme(). Props johnbillion, MarcusPope. see <a href="http://core.trac.wordpress.org/ticket/19037">#19037</a> <a href="http://core.trac.wordpress.org/ticket/20759">#20759</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswplisttablephp">trunk/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunkwpadminincludespluginphp">trunk/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunkwpincludesclasswpeditorphp">trunk/wp-includes/class-wp-editor.php</a></li>
<li><a href="#trunkwpincludesclasswpxmlrpcserverphp">trunk/wp-includes/class-wp-xmlrpc-server.php</a></li>
<li><a href="#trunkwpincludesfeedphp">trunk/wp-includes/feed.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunkwpincludespluggablephp">trunk/wp-includes/pluggable.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
<li><a href="#trunkwploginphp">trunk/wp-login.php</a></li>
<li><a href="#trunkwpsignupphp">trunk/wp-signup.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-list-table.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -490,7 +490,7 @@
</span><span class="cx">
</span><span class="cx">                 $current = $this->get_pagenum();
</span><span class="cx">
</span><del>-                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
</del><ins>+                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">
</span><span class="cx">                 $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
</span><span class="cx">
</span><span class="lines">@@ -651,7 +651,7 @@
</span><span class="cx">
</span><span class="cx">                 list( $columns, $hidden, $sortable ) = $this->get_column_info();
</span><span class="cx">
</span><del>-                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
</del><ins>+                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">                 $current_url = remove_query_arg( 'paged', $current_url );
</span><span class="cx">
</span><span class="cx">                 if ( isset( $_GET['orderby'] ) )
</span></span></pre></div>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-admin/includes/meta-boxes.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -41,9 +41,7 @@
</span><span class="cx">         $preview_link = esc_url( get_permalink( $post->ID ) );
</span><span class="cx">         $preview_button = __( 'Preview Changes' );
</span><span class="cx"> } else {
</span><del>-        $preview_link = get_permalink( $post->ID );
-        if ( is_ssl() )
-                $preview_link = str_replace( 'http://', 'https://', $preview_link );
</del><ins>+        $preview_link = set_url_scheme( get_permalink( $post->ID ) );
</ins><span class="cx">         $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
</span><span class="cx">         $preview_button = __( 'Preview' );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpadminincludespluginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/plugin.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/plugin.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-admin/includes/plugin.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -903,8 +903,8 @@
</span><span class="cx">
</span><span class="cx">         if ( empty($icon_url) )
</span><span class="cx">                 $icon_url = esc_url( admin_url( 'images/generic.png' ) );
</span><del>-        elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
-                $icon_url = 'https://' . substr($icon_url, 7);
</del><ins>+        else
+                $icon_url = set_url_scheme( $icon_url );
</ins><span class="cx">
</span><span class="cx">         $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesclasswpeditorphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-editor.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-editor.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/class-wp-editor.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx">
</span><span class="cx">                                                 foreach ( $mce_external_plugins as $name => $url ) {
</span><span class="cx">
</span><del>-                                                        if ( is_ssl() ) $url = str_replace('http://', 'https://', $url);
</del><ins>+                                                        $url = set_url_scheme( $url );
</ins><span class="cx">
</span><span class="cx">                                                         $plugins[] = '-' . $name;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesclasswpxmlrpcserverphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-xmlrpc-server.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-xmlrpc-server.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/class-wp-xmlrpc-server.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -3221,9 +3221,8 @@
</span><span class="cx">                 global $current_blog;
</span><span class="cx">                 $domain = $current_blog->domain;
</span><span class="cx">                 $path = $current_blog->path . 'xmlrpc.php';
</span><del>-                $protocol = is_ssl() ? 'https' : 'http';
</del><span class="cx">
</span><del>-                $rpc = new IXR_Client("$protocol://{$domain}{$path}");
</del><ins>+                $rpc = new IXR_Client( set_url_scheme( "http://{$domain}{$path}" ) );
</ins><span class="cx">                 $rpc->query('wp.getUsersBlogs', $args[1], $args[2]);
</span><span class="cx">                 $blogs = $rpc->getResponse();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/feed.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -488,12 +488,7 @@
</span><span class="cx"> */
</span><span class="cx"> function self_link() {
</span><span class="cx">         $host = @parse_url(home_url());
</span><del>-        $host = $host['host'];
-        echo esc_url(
-                ( is_ssl() ? 'https' : 'http' ) . '://'
-                . $host
-                . stripslashes($_SERVER['REQUEST_URI'])
-                );
</del><ins>+        echo esc_url( set_url_scheme( 'http://' . $host['host'] . stripslashes($_SERVER['REQUEST_URI']) ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/functions.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -2585,8 +2585,8 @@
</span><span class="cx"> */
</span><span class="cx"> function url_is_accessable_via_ssl($url)
</span><span class="cx"> {
</span><del>-        if (in_array('curl', get_loaded_extensions())) {
-                $ssl = preg_replace( '/^http:\/\//', 'https://', $url );
</del><ins>+        if ( in_array( 'curl', get_loaded_extensions() ) ) {
+                $ssl = set_url_scheme( $url, 'https' );
</ins><span class="cx">
</span><span class="cx">                 $ch = curl_init();
</span><span class="cx">                 curl_setopt($ch, CURLOPT_URL, $ssl);
</span><span class="lines">@@ -2933,12 +2933,11 @@
</span><span class="cx"> * @return string
</span><span class="cx"> */
</span><span class="cx"> function wp_guess_url() {
</span><del>-        if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
</del><ins>+        if ( defined('WP_SITEURL') && '' != WP_SITEURL )
</ins><span class="cx">                 $url = WP_SITEURL;
</span><del>-        } else {
-                $schema = is_ssl() ? 'https://' : 'http://';
-                $url = preg_replace('#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
-        }
</del><ins>+        else
+                $url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
+
</ins><span class="cx">         return rtrim($url, '/');
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/link-template.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -2049,9 +2049,7 @@
</span><span class="cx"> * @return string Content url link with optional path appended.
</span><span class="cx"> */
</span><span class="cx"> function content_url($path = '') {
</span><del>-        $url = WP_CONTENT_URL;
-        if ( 0 === strpos($url, 'http') && is_ssl() )
-                $url = str_replace( 'http://', 'https://', $url );
</del><ins>+        $url = set_url_scheme( WP_CONTENT_URL );
</ins><span class="cx">
</span><span class="cx">         if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
</span><span class="cx">                 $url .= '/' . ltrim($path, '/');
</span><span class="lines">@@ -2083,8 +2081,8 @@
</span><span class="cx">         else
</span><span class="cx">                 $url = WP_PLUGIN_URL;
</span><span class="cx">
</span><del>-        if ( 0 === strpos($url, 'http') && is_ssl() )
-                $url = str_replace( 'http://', 'https://', $url );
</del><ins>+        
+        $url = set_url_scheme( $url );
</ins><span class="cx">
</span><span class="cx">         if ( !empty($plugin) && is_string($plugin) ) {
</span><span class="cx">                 $folder = dirname(plugin_basename($plugin));
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/ms-functions.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -1875,22 +1875,22 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Formats an String URL to use HTTPS if HTTP is found.
</del><ins>+ * Formats a URL to use https.
+ *
</ins><span class="cx"> * Useful as a filter.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.8.5
</span><del>- **/
</del><ins>+ *
+ * @param string URL
+ * @return string URL with https as the scheme
+ */
</ins><span class="cx"> function filter_SSL( $url ) {
</span><del>-        if ( !is_string( $url ) )
-                return get_bloginfo( 'url' ); //return home blog url with proper scheme
</del><ins>+        if ( ! is_string( $url ) )
+                return get_bloginfo( 'url' ); // Return home blog url with proper scheme
</ins><span class="cx">
</span><del>-        $arrURL = parse_url( $url );
</del><ins>+        if ( force_ssl_content() && is_ssl() )
+                $url = set_url_scheme( $url, 'https' );
</ins><span class="cx">
</span><del>-        if ( force_ssl_content() && is_ssl() ) {
-                if ( 'http' === $arrURL['scheme'] )
-                        $url = str_replace( $arrURL['scheme'], 'https', $url );
-        }
-
</del><span class="cx">         return $url;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/nav-menu-template.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx">                 // if the menu item corresponds to the currently-requested URL
</span><span class="cx">                 } elseif ( 'custom' == $menu_item->object ) {
</span><span class="cx">                         $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] );
</span><del>-                        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_root_relative_current;
</del><ins>+                        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current );
</ins><span class="cx">                         $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
</span><span class="cx">                         $item_url = untrailingslashit( $raw_item_url );
</span><span class="cx">                         $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
</span></span></pre></div>
<a id="trunkwpincludespluggablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pluggable.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pluggable.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/pluggable.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -748,11 +748,11 @@
</span><span class="cx">
</span><span class="cx">         // If https is required and request is http, redirect
</span><span class="cx">         if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
</span><del>-                if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
-                        wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
</del><ins>+                if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
+                        wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
</ins><span class="cx">                         exit();
</span><span class="cx">                 } else {
</span><del>-                        wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
</del><ins>+                        wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">                         exit();
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -767,11 +767,11 @@
</span><span class="cx">
</span><span class="cx">                 // If the user wants ssl but the session is not ssl, redirect.
</span><span class="cx">                 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
</span><del>-                        if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
-                                wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
</del><ins>+                        if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
+                                wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
</ins><span class="cx">                                 exit();
</span><span class="cx">                         } else {
</span><del>-                                wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
</del><ins>+                                wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">                                 exit();
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -782,13 +782,8 @@
</span><span class="cx">         // The cookie is no good so force login
</span><span class="cx">         nocache_headers();
</span><span class="cx">
</span><del>-        if ( is_ssl() )
-                $proto = 'https://';
-        else
-                $proto = 'http://';
</del><ins>+        $redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">
</span><del>-        $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
-
</del><span class="cx">         $login_url = wp_login_url($redirect, true);
</span><span class="cx">
</span><span class="cx">         wp_redirect($login_url);
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-includes/theme.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -891,12 +891,7 @@
</span><span class="cx">         if ( is_random_header_image() )
</span><span class="cx">                 $url = get_random_header_image();
</span><span class="cx">
</span><del>-        if ( is_ssl() )
-                $url = str_replace( 'http://', 'https://', $url );
-        else
-                $url = str_replace( 'https://', 'http://', $url );
-
-        return esc_url_raw( $url );
</del><ins>+        return esc_url_raw( set_url_scheme( $url ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwploginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-login.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-login.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-login.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -12,12 +12,12 @@
</span><span class="cx"> require( dirname(__FILE__) . '/wp-load.php' );
</span><span class="cx">
</span><span class="cx"> // Redirect to https login if forced to use SSL
</span><del>-if ( force_ssl_admin() && !is_ssl() ) {
</del><ins>+if ( force_ssl_admin() && ! is_ssl() ) {
</ins><span class="cx">         if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
</span><del>-                wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
</del><ins>+                wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
</ins><span class="cx">                 exit();
</span><span class="cx">         } else {
</span><del>-                wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
</del><ins>+                wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</ins><span class="cx">                 exit();
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -365,9 +365,9 @@
</span><span class="cx">         if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
</span><span class="cx">                 $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
</span><span class="cx">
</span><del>-        $schema = is_ssl() ? 'https://' : 'http://';
-        if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') )
-                update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
</del><ins>+        $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );
+        if ( $url != get_option( 'siteurl' ) )
+                update_option( 'siteurl', $url );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> //Set a cookie now to see if they are supported by the browser.
</span></span></pre></div>
<a id="trunkwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-signup.php (21663 => 21664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-signup.php        2012-08-30 04:09:57 UTC (rev 21663)
+++ trunk/wp-signup.php        2012-08-30 13:33:00 UTC (rev 21664)
</span><span class="lines">@@ -390,11 +390,7 @@
</span><span class="cx"> if ( $active_signup == 'none' ) {
</span><span class="cx">         _e( 'Registration has been disabled.' );
</span><span class="cx"> } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
</span><del>-        if ( is_ssl() )
-                $proto = 'https://';
-        else
-                $proto = 'http://';
-        $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ));
</del><ins>+        $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ) ) );
</ins><span class="cx">         echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url );
</span><span class="cx"> } else {
</span><span class="cx">         $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';
</span></span></pre>
</div>
</div>
</body>
</html>