Ticket #19037: 19037.diff
File 19037.diff, 11.7 KB (added by , 13 years ago) |
---|
-
wp-signup.php
390 390 if ( $active_signup == 'none' ) { 391 391 _e( 'Registration has been disabled.' ); 392 392 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { 393 if ( is_ssl() ) 394 $proto = 'https://'; 395 else 396 $proto = 'http://'; 397 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' )); 393 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ) ) ); 398 394 echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 399 395 } else { 400 396 $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; -
wp-login.php
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() ) {15 if ( force_ssl_admin() && ! is_ssl() ) { 16 16 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 17 wp_redirect( preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));17 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); 18 18 exit(); 19 19 } else { 20 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);20 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 21 21 exit(); 22 22 } 23 23 } … … 365 365 if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) 366 366 $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); 367 367 368 $ schema = is_ssl() ? 'https://' : 'http://';369 if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') )370 update_option( 'siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']));368 $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); 369 if ( $url != get_option( 'siteurl' ) ) 370 update_option( 'siteurl', $url ); 371 371 } 372 372 373 373 //Set a cookie now to see if they are supported by the browser. -
wp-includes/nav-menu-template.php
358 358 // if the menu item corresponds to the currently-requested URL 359 359 } elseif ( 'custom' == $menu_item->object ) { 360 360 $_root_relative_current = untrailingslashit( $_SERVER['REQUEST_URI'] ); 361 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_root_relative_current;361 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current ); 362 362 $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url; 363 363 $item_url = untrailingslashit( $raw_item_url ); 364 364 $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) ); -
wp-includes/theme.php
891 891 if ( is_random_header_image() ) 892 892 $url = get_random_header_image(); 893 893 894 if ( is_ssl() ) 895 $url = str_replace( 'http://', 'https://', $url ); 896 else 897 $url = str_replace( 'https://', 'http://', $url ); 898 899 return esc_url_raw( $url ); 894 return esc_url_raw( set_url_scheme( $url ) ); 900 895 } 901 896 902 897 /** -
wp-includes/functions.php
2933 2933 * @return string 2934 2934 */ 2935 2935 function wp_guess_url() { 2936 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {2936 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) 2937 2937 $url = WP_SITEURL; 2938 } else { 2939 $schema = is_ssl() ? 'https://' : 'http://'; 2940 $url = preg_replace('#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 2941 } 2938 else 2939 $url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ); 2940 2942 2941 return rtrim($url, '/'); 2943 2942 } 2944 2943 -
wp-includes/class-wp-xmlrpc-server.php
3221 3221 global $current_blog; 3222 3222 $domain = $current_blog->domain; 3223 3223 $path = $current_blog->path . 'xmlrpc.php'; 3224 $protocol = is_ssl() ? 'https' : 'http';3225 3224 3226 $rpc = new IXR_Client( "$protocol://{$domain}{$path}");3225 $rpc = new IXR_Client( set_url_scheme( "http://{$domain}{$path}" ) ); 3227 3226 $rpc->query('wp.getUsersBlogs', $args[1], $args[2]); 3228 3227 $blogs = $rpc->getResponse(); 3229 3228 -
wp-includes/link-template.php
2049 2049 * @return string Content url link with optional path appended. 2050 2050 */ 2051 2051 function content_url($path = '') { 2052 $url = WP_CONTENT_URL; 2053 if ( 0 === strpos($url, 'http') && is_ssl() ) 2054 $url = str_replace( 'http://', 'https://', $url ); 2052 $url = set_url_scheme( WP_CONTENT_URL ); 2055 2053 2056 2054 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 2057 2055 $url .= '/' . ltrim($path, '/'); … … 2083 2081 else 2084 2082 $url = WP_PLUGIN_URL; 2085 2083 2086 if ( 0 === strpos($url, 'http') && is_ssl() )2087 $url = str_replace( 'http://', 'https://',$url );2084 2085 $url = set_url_scheme( $url ); 2088 2086 2089 2087 if ( !empty($plugin) && is_string($plugin) ) { 2090 2088 $folder = dirname(plugin_basename($plugin)); -
wp-includes/pluggable.php
748 748 749 749 // If https is required and request is http, redirect 750 750 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 751 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http') ) {752 wp_redirect( preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));751 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 752 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); 753 753 exit(); 754 754 } else { 755 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);755 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 756 756 exit(); 757 757 } 758 758 } … … 767 767 768 768 // If the user wants ssl but the session is not ssl, redirect. 769 769 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 770 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http') ) {771 wp_redirect( preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));770 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 771 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); 772 772 exit(); 773 773 } else { 774 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);774 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 775 775 exit(); 776 776 } 777 777 } … … 782 782 // The cookie is no good so force login 783 783 nocache_headers(); 784 784 785 if ( is_ssl() ) 786 $proto = 'https://'; 787 else 788 $proto = 'http://'; 785 $redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 789 786 790 $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];791 792 787 $login_url = wp_login_url($redirect, true); 793 788 794 789 wp_redirect($login_url); -
wp-includes/feed.php
488 488 */ 489 489 function self_link() { 490 490 $host = @parse_url(home_url()); 491 $host = $host['host']; 492 echo esc_url( 493 ( is_ssl() ? 'https' : 'http' ) . '://' 494 . $host 495 . stripslashes($_SERVER['REQUEST_URI']) 496 ); 491 echo esc_url( set_url_scheme( 'http://' . $host['host'] . stripslashes($_SERVER['REQUEST_URI']) ) ); 497 492 } 498 493 499 494 /** -
wp-includes/ms-functions.php
1875 1875 } 1876 1876 1877 1877 /** 1878 * Formats an String URL to use HTTPS if HTTP is found. 1878 * Formats a URL to use https. 1879 * 1879 1880 * Useful as a filter. 1880 1881 * 1881 1882 * @since 2.8.5 1882 **/ 1883 * 1884 * @param string URL 1885 * @return string URL with https as the scheme 1886 */ 1883 1887 function filter_SSL( $url ) { 1884 if ( ! is_string( $url ) )1885 return get_bloginfo( 'url' ); // return home blog url with proper scheme1888 if ( ! is_string( $url ) ) 1889 return get_bloginfo( 'url' ); // Return home blog url with proper scheme 1886 1890 1887 $arrURL = parse_url( $url ); 1891 if ( force_ssl_content() && is_ssl() ) 1892 $url = set_url_scheme( $url, 'https' ); 1888 1893 1889 if ( force_ssl_content() && is_ssl() ) {1890 if ( 'http' === $arrURL['scheme'] )1891 $url = str_replace( $arrURL['scheme'], 'https', $url );1892 }1893 1894 1894 return $url; 1895 1895 } 1896 1896 -
wp-admin/includes/plugin.php
903 903 904 904 if ( empty($icon_url) ) 905 905 $icon_url = esc_url( admin_url( 'images/generic.png' ) ); 906 else if ( is_ssl() && 0 === strpos($icon_url, 'http://') )907 $icon_url = 'https://' . substr($icon_url, 7);906 else 907 $icon_url = set_url_scheme( $icon_url ); 908 908 909 909 $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 910 910 -
wp-admin/includes/class-wp-list-table.php
490 490 491 491 $current = $this->get_pagenum(); 492 492 493 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];493 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 494 494 495 495 $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url ); 496 496 … … 651 651 652 652 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 653 653 654 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];654 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 655 655 $current_url = remove_query_arg( 'paged', $current_url ); 656 656 657 657 if ( isset( $_GET['orderby'] ) ) -
wp-admin/includes/meta-boxes.php
41 41 $preview_link = esc_url( get_permalink( $post->ID ) ); 42 42 $preview_button = __( 'Preview Changes' ); 43 43 } else { 44 $preview_link = get_permalink( $post->ID ); 45 if ( is_ssl() ) 46 $preview_link = str_replace( 'http://', 'https://', $preview_link ); 44 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); 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 }