Ticket #19037: ssl.patch
File ssl.patch, 22.3 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-list-table.php
diff -r 0c4c93d6bc0c wp-admin/includes/class-wp-list-table.php
a b 486 486 487 487 $current = $this->get_pagenum(); 488 488 489 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];489 $current_url = scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 490 490 491 491 $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url ); 492 492 … … 645 645 646 646 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 647 647 648 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];648 $current_url = scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 649 649 $current_url = remove_query_arg( 'paged', $current_url ); 650 650 651 651 if ( isset( $_GET['orderby'] ) ) -
wp-admin/includes/class-wp-themes-list-table.php
diff -r 0c4c93d6bc0c wp-admin/includes/class-wp-themes-list-table.php
a b 155 155 $parent_theme = $themes[$theme_name]['Parent Theme']; 156 156 $theme_root = $themes[$theme_name]['Theme Root']; 157 157 $theme_root_uri = $themes[$theme_name]['Theme Root URI']; 158 $preview_link = esc_url( get_option( 'home' ) . '/' ); 159 if ( is_ssl() ) 160 $preview_link = str_replace( 'http://', 'https://', $preview_link ); 158 $preview_link = scheme( esc_url( get_option( 'home' ) . '/' ) ); 161 159 $preview_link = htmlspecialchars( add_query_arg( array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), $preview_link ) ); 162 160 $preview_text = esc_attr( sprintf( __( 'Preview of “%s”' ), $title ) ); 163 161 $tags = $themes[$theme_name]['Tags']; -
wp-admin/includes/meta-boxes.php
diff -r 0c4c93d6bc0c wp-admin/includes/meta-boxes.php
a b 42 42 $preview_button = __( 'Preview Changes' ); 43 43 } else { 44 44 $preview_link = get_permalink( $post->ID ); 45 if ( is_ssl() )46 $preview_link = str_replace( 'http://', 'https://', $preview_link );47 45 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); 48 46 $preview_button = __( 'Preview' ); 49 47 } -
wp-admin/includes/plugin.php
diff -r 0c4c93d6bc0c wp-admin/includes/plugin.php
a b 877 877 878 878 if ( empty($icon_url) ) 879 879 $icon_url = esc_url( admin_url( 'images/generic.png' ) ); 880 elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )881 $icon_url = 'https://' . substr($icon_url, 7);882 880 883 $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url);881 $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, scheme($icon_url) ); 884 882 885 883 if ( null === $position ) 886 884 $menu[] = $new_menu; -
wp-admin/includes/post.php
diff -r 0c4c93d6bc0c wp-admin/includes/post.php
a b 1488 1488 1489 1489 foreach ( $mce_external_plugins as $name => $url ) { 1490 1490 1491 if ( is_ssl() ) $url = str_replace('http://', 'https://',$url);1491 $url = scheme($url); 1492 1492 1493 1493 $plugins[] = '-' . $name; 1494 1494 … … 1860 1860 <div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div> 1861 1861 <?php 1862 1862 } 1863 1864 -
wp-admin/network/site-info.php
diff -r 0c4c93d6bc0c wp-admin/network/site-info.php
a b 118 118 <tr class="form-field form-required"> 119 119 <th scope="row"><?php _e( 'Domain' ) ?></th> 120 120 <?php 121 $protocol = is_ssl() ? 'https://' : 'http://';122 121 if ( $is_main_site ) { ?> 123 <td><code><?php echo $protocol; echoesc_attr( $details->domain ) ?></code></td>122 <td><code><?php echo esc_attr( $details->domain ) ?></code></td> 124 123 <?php } else { ?> 125 <td>< ?php echo $protocol; ?><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" size="33" /></td>124 <td><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" size="33" /></td> 126 125 <?php } ?> 127 126 </tr> 128 127 <tr class="form-field form-required"> -
wp-admin/setup-config.php
diff -r 0c4c93d6bc0c wp-admin/setup-config.php
a b 192 192 * @ignore 193 193 */ 194 194 function get_bloginfo() { 195 return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '') );195 return ( scheme( 'http://' . $_SERVER['HTTP_HOST'] ) ); 196 196 } 197 197 /**#@-*/ 198 198 $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); -
wp-includes/canonical.php
diff -r 0c4c93d6bc0c wp-includes/canonical.php
a b 40 40 if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || $is_IIS ) 41 41 return; 42 42 43 if ( ! $requested_url ) {43 if ( ! $requested_url ) { 44 44 // build the URL in the address bar 45 $requested_url = is_ssl() ? 'https://' : 'http://'; 46 $requested_url .= $_SERVER['HTTP_HOST']; 47 $requested_url .= $_SERVER['REQUEST_URI']; 45 $requested_url = scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 48 46 } 49 47 50 48 $original = @parse_url($requested_url); -
wp-includes/class-wp-admin-bar.php
diff -r 0c4c93d6bc0c wp-includes/class-wp-admin-bar.php
a b 3 3 var $changed_locale = false; 4 4 var $menu; 5 5 var $need_to_change_locale = false; 6 var $proto = 'http://';7 6 var $user; 8 7 9 8 function initialize() { 10 /* Set the protocol used throughout this code */11 if ( is_ssl() )12 $this->proto = 'https://';13 14 9 $this->user = new stdClass; 15 10 $this->menu = new stdClass; 16 11 -
wp-includes/class-wp-xmlrpc-server.php
diff -r 0c4c93d6bc0c wp-includes/class-wp-xmlrpc-server.php
a b 1752 1752 global $current_blog; 1753 1753 $domain = $current_blog->domain; 1754 1754 $path = $current_blog->path . 'xmlrpc.php'; 1755 $protocol = is_ssl() ? 'https' : 'http'; 1756 1757 $rpc = new IXR_Client("$protocol://{$domain}{$path}"); 1755 1756 $rpc = new IXR_Client(scheme("http://{$domain}{$path}")); 1758 1757 $rpc->query('wp.getUsersBlogs', $args[1], $args[2]); 1759 1758 $blogs = $rpc->getResponse(); 1760 1759 -
wp-includes/feed.php
diff -r 0c4c93d6bc0c wp-includes/feed.php
a b 486 486 */ 487 487 function self_link() { 488 488 $host = @parse_url(home_url()); 489 $host = $host['host']; 490 echo esc_url( 491 'http' 492 . ( (isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '' ) . '://' 493 . $host 494 . stripslashes($_SERVER['REQUEST_URI']) 495 ); 489 echo esc_url( $host['scheme'] . '://' . $host['host'] . stripslashes( $_SERVER['REQUEST_URI'] ) ); 496 490 } 497 491 498 492 /** -
wp-includes/functions.php
diff -r 0c4c93d6bc0c wp-includes/functions.php
a b 3622 3622 } 3623 3623 3624 3624 /** 3625 * Properly format the scheme of any URL based on SSL state. Safe for use with relative URLs 3626 * 3627 * @since 3.2.X 3628 * 3629 * @param string $url 3630 * @return string A string representing a url with the proper scheme given the SSL state of this site 3631 */ 3632 function scheme( $url ) { 3633 if (is_ssl()) { 3634 $url = str_replace('http://', 'https://', $url); 3635 } 3636 else { 3637 $url = str_replace('https://', 'http://', $url); 3638 } 3639 3640 return $url; 3641 } 3642 3643 /** 3644 * Forces an ssl redirect for authentication if SSL is required and we're not currently using an HTTPS scheme 3645 * 3646 * @since 3.2.X 3647 * 3648 * @return bool true if request needs secure redirect 3649 */ 3650 function ssl_redirect() { 3651 3652 $secure = ( is_ssl() || force_ssl_admin() ); 3653 3654 $secure = apply_filters('secure_auth_redirect', $secure); 3655 3656 // If https is required and request is http, redirect 3657 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 3658 do_ssl_redirect(); 3659 } 3660 3661 return $secure; 3662 } 3663 3664 /** 3665 * Does actual redirect for https scheme 3666 * 3667 * @since 3.2.X 3668 * 3669 * @return null 3670 */ 3671 function do_ssl_redirect() { 3672 3673 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 3674 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 3675 exit(); 3676 } else { 3677 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 3678 exit(); 3679 } 3680 } 3681 3682 /** 3625 3683 * Whether SSL login should be forced. 3626 3684 * 3627 3685 * @since 2.6.0 … … 3675 3733 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 3676 3734 $url = WP_SITEURL; 3677 3735 } else { 3678 $schema = is_ssl() ? 'https://' : 'http://'; 3679 $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 3736 $url = preg_replace('|/wp-admin/.*|i', '', scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); 3680 3737 } 3681 3738 return rtrim($url, '/'); 3682 3739 } -
wp-includes/link-template.php
diff -r 0c4c93d6bc0c wp-includes/link-template.php
a b 1926 1926 * Retrieve the home url for the current site. 1927 1927 * 1928 1928 * Returns the 'home' option with the appropriate protocol, 'https' if 1929 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is1929 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 1930 1930 * overridden. 1931 1931 * 1932 1932 * @package WordPress … … 1946 1946 * Retrieve the home url for a given site. 1947 1947 * 1948 1948 * Returns the 'home' option with the appropriate protocol, 'https' if 1949 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is1949 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 1950 1950 * overridden. 1951 1951 * 1952 1952 * @package WordPress … … 1981 1981 * Retrieve the site url for the current site. 1982 1982 * 1983 1983 * Returns the 'site_url' option with the appropriate protocol, 'https' if 1984 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is1984 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 1985 1985 * overridden. 1986 1986 * 1987 1987 * @package WordPress … … 2001 2001 * Retrieve the site url for a given site. 2002 2002 * 2003 2003 * Returns the 'site_url' option with the appropriate protocol, 'https' if 2004 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is2004 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 2005 2005 * overridden. 2006 2006 * 2007 2007 * @package WordPress … … 2047 2047 * @since 2.6.0 2048 2048 * 2049 2049 * @param string $path Optional path relative to the admin url 2050 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2050 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2051 2051 * @return string Admin url link with optional path appended 2052 2052 */ 2053 2053 function admin_url( $path = '', $scheme = 'admin' ) { … … 2062 2062 * 2063 2063 * @param int $blog_id (optional) Blog ID. Defaults to current blog. 2064 2064 * @param string $path Optional path relative to the admin url 2065 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2065 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2066 2066 * @return string Admin url link with optional path appended 2067 2067 */ 2068 2068 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { … … 2102 2102 * @return string Content url link with optional path appended. 2103 2103 */ 2104 2104 function content_url($path = '') { 2105 $url = WP_CONTENT_URL; 2106 if ( 0 === strpos($url, 'http') && is_ssl() ) 2107 $url = str_replace( 'http://', 'https://', $url ); 2105 $url = scheme( WP_CONTENT_URL ); 2108 2106 2109 2107 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 2110 2108 $url .= '/' . ltrim($path, '/'); … … 2136 2134 else 2137 2135 $url = WP_PLUGIN_URL; 2138 2136 2139 if ( 0 === strpos($url, 'http') && is_ssl() ) 2140 $url = str_replace( 'http://', 'https://', $url ); 2137 $url = scheme($url); 2141 2138 2142 2139 if ( !empty($plugin) && is_string($plugin) ) { 2143 2140 $folder = dirname(plugin_basename($plugin)); … … 2155 2152 * Retrieve the site url for the current network. 2156 2153 * 2157 2154 * Returns the site url with the appropriate protocol, 'https' if 2158 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is2155 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 2159 2156 * overridden. 2160 2157 * 2161 2158 * @package WordPress … … 2195 2192 * Retrieve the home url for the current network. 2196 2193 * 2197 2194 * Returns the home url with the appropriate protocol, 'https' if 2198 * is_ssl () and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl()is2195 * is_ssl and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl is 2199 2196 * overridden. 2200 2197 * 2201 2198 * @package WordPress … … 2231 2228 * @since 3.0.0 2232 2229 * 2233 2230 * @param string $path Optional path relative to the admin url 2234 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2231 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2235 2232 * @return string Admin url link with optional path appended 2236 2233 */ 2237 2234 function network_admin_url( $path = '', $scheme = 'admin' ) { … … 2253 2250 * @since 3.0.0 2254 2251 * 2255 2252 * @param string $path Optional path relative to the admin url 2256 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2253 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2257 2254 * @return string Admin url link with optional path appended 2258 2255 */ 2259 2256 function user_admin_url( $path = '', $scheme = 'admin' ) { … … 2272 2269 * @since 3.1.0 2273 2270 * 2274 2271 * @param string $path Optional path relative to the admin url 2275 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2272 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2276 2273 * @return string Admin url link with optional path appended 2277 2274 */ 2278 2275 function self_admin_url($path = '', $scheme = 'admin') { … … 2295 2292 * 2296 2293 * @param int $user_id User ID 2297 2294 * @param string $path Optional path relative to the dashboard. Use only paths known to both blog and user admins. 2298 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2295 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2299 2296 * @return string Dashboard url link with optional path appended 2300 2297 */ 2301 2298 function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) { … … 2328 2325 * @since 3.1.0 2329 2326 * 2330 2327 * @param int $user User ID 2331 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl (). 'http' or 'https' can be passed to force those schemes.2328 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl. 'http' or 'https' can be passed to force those schemes. 2332 2329 * @return string Dashboard url link with optional path appended 2333 2330 */ 2334 2331 function get_edit_profile_url( $user, $scheme = 'admin' ) { -
wp-includes/ms-functions.php
diff -r 0c4c93d6bc0c wp-includes/ms-functions.php
a b 2035 2035 2036 2036 $arrURL = parse_url( $url ); 2037 2037 2038 if ( force_ssl_content() && is_ssl() ) { 2039 if ( 'http' === $arrURL['scheme'] && 'https' !== $arrURL['scheme'] ) 2040 $url = str_replace( $arrURL['scheme'], 'https', $url ); 2038 if ( 'http' === $arrURL['scheme'] && force_ssl_content() && is_ssl() ) { 2039 $url = str_replace( $arrURL['scheme'], 'https', $url ); 2041 2040 } 2042 2041 2043 2042 return $url; -
wp-includes/nav-menu-template.php
diff -r 0c4c93d6bc0c wp-includes/nav-menu-template.php
a b 360 360 361 361 // if the menu item corresponds to the currently-requested URL 362 362 } elseif ( 'custom' == $menu_item->object ) { 363 $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);363 $current_url = untrailingslashit( scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ); 364 364 $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url ); 365 365 $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) ); 366 366 -
wp-includes/pluggable.php
diff -r 0c4c93d6bc0c wp-includes/pluggable.php
a b 799 799 function auth_redirect() { 800 800 // Checks if a user is logged in, if not redirects them to the login page 801 801 802 $secure = ( is_ssl() || force_ssl_admin() ); 803 804 $secure = apply_filters('secure_auth_redirect', $secure); 805 806 // If https is required and request is http, redirect 807 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 808 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 809 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 810 exit(); 811 } else { 812 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 813 exit(); 814 } 815 } 802 $secure = ssl_redirect(); 816 803 817 804 if ( is_user_admin() ) 818 805 $scheme = 'logged_in'; … … 824 811 825 812 // If the user wants ssl but the session is not ssl, redirect. 826 813 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 827 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 828 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 829 exit(); 830 } else { 831 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 832 exit(); 833 } 814 do_ssl_redirect(); 834 815 } 835 816 836 817 return; // The cookie is good so we're done … … 839 820 // The cookie is no good so force login 840 821 nocache_headers(); 841 822 842 if ( is_ssl() ) 843 $proto = 'https://'; 844 else 845 $proto = 'http://'; 823 if ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) { 824 $redirect = wp_get_referer(); 825 } 826 else { 827 $redirect = scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 828 } 846 829 847 $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 848 849 $login_url = wp_login_url($redirect, true); 850 851 wp_redirect($login_url); 830 wp_redirect( wp_login_url($redirect, true) ); 852 831 exit(); 853 832 } 854 833 endif; -
wp-includes/theme.php
diff -r 0c4c93d6bc0c wp-includes/theme.php
a b 1437 1437 if ( is_random_header_image() ) 1438 1438 $url = get_random_header_image(); 1439 1439 1440 if ( is_ssl() ) 1441 $url = str_replace( 'http://', 'https://', $url ); 1442 else 1443 $url = str_replace( 'https://', 'http://', $url ); 1444 1445 return esc_url_raw( $url ); 1440 return esc_url_raw( scheme( $url ) ); 1446 1441 } 1447 1442 1448 1443 /** -
wp-login.php
diff -r 0c4c93d6bc0c wp-login.php
a b 12 12 require( dirname(__FILE__) . '/wp-load.php' ); 13 13 14 14 // Redirect to https login if forced to use SSL 15 if ( force_ssl_admin() && !is_ssl() ) { 16 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 17 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 18 exit(); 19 } else { 20 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 21 exit(); 22 } 23 } 15 ssl_redirect(); 24 16 25 17 /** 26 18 * Outputs the header for the login page. … … 356 348 if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) 357 349 $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); 358 350 359 $ schema = is_ssl() ? 'https://' : 'http://';360 if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])!= get_option('siteurl') )361 update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']));351 $path = dirname( scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); 352 if ( $path != get_option('siteurl') ) 353 update_option('siteurl', $path); 362 354 } 363 355 364 356 //Set a cookie now to see if they are supported by the browser. -
wp-signup.php
diff -r 0c4c93d6bc0c wp-signup.php
a b 399 399 if ( $active_signup == 'none' ) { 400 400 _e( 'Registration has been disabled.' ); 401 401 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { 402 if ( is_ssl() ) 403 $proto = 'https://'; 404 else 405 $proto = 'http://'; 406 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' )); 402 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( scheme( 'http://' . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ))); 407 403 echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 408 404 } else { 409 405 $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';