Changeset 21664
- Timestamp:
- 08/30/2012 01:33:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-list-table.php
r21323 r21664 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 ); … … 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 -
trunk/wp-admin/includes/meta-boxes.php
r21311 r21664 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' ); -
trunk/wp-admin/includes/plugin.php
r21291 r21664 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 ); -
trunk/wp-includes/class-wp-editor.php
r21576 r21664 212 212 foreach ( $mce_external_plugins as $name => $url ) { 213 213 214 if ( is_ssl() ) $url = str_replace('http://', 'https://', $url);214 $url = set_url_scheme( $url ); 215 215 216 216 $plugins[] = '-' . $name; -
trunk/wp-includes/class-wp-xmlrpc-server.php
r21651 r21664 3222 3222 $domain = $current_blog->domain; 3223 3223 $path = $current_blog->path . 'xmlrpc.php'; 3224 $protocol = is_ssl() ? 'https' : 'http'; 3225 3226 $rpc = new IXR_Client("$protocol://{$domain}{$path}"); 3224 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(); -
trunk/wp-includes/feed.php
r21652 r21664 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 -
trunk/wp-includes/functions.php
r21541 r21664 2586 2586 function url_is_accessable_via_ssl($url) 2587 2587 { 2588 if ( in_array('curl', get_loaded_extensions())) {2589 $ssl = preg_replace( '/^http:\/\//', 'https://', $url);2588 if ( in_array( 'curl', get_loaded_extensions() ) ) { 2589 $ssl = set_url_scheme( $url, 'https' ); 2590 2590 2591 2591 $ch = curl_init(); … … 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 } -
trunk/wp-includes/link-template.php
r21662 r21664 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 ) … … 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) ) { -
trunk/wp-includes/ms-functions.php
r21628 r21664 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 scheme 1886 1887 $arrURL = parse_url( $url ); 1888 1889 if ( force_ssl_content() && is_ssl() ) { 1890 if ( 'http' === $arrURL['scheme'] ) 1891 $url = str_replace( $arrURL['scheme'], 'https', $url ); 1892 } 1888 if ( ! is_string( $url ) ) 1889 return get_bloginfo( 'url' ); // Return home blog url with proper scheme 1890 1891 if ( force_ssl_content() && is_ssl() ) 1892 $url = set_url_scheme( $url, 'https' ); 1893 1893 1894 1894 return $url; -
trunk/wp-includes/nav-menu-template.php
r21559 r21664 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 ); -
trunk/wp-includes/pluggable.php
r21563 r21664 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 } … … 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 } … … 783 783 nocache_headers(); 784 784 785 if ( is_ssl() ) 786 $proto = 'https://'; 787 else 788 $proto = 'http://'; 789 790 $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 785 $redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 791 786 792 787 $login_url = wp_login_url($redirect, true); -
trunk/wp-includes/theme.php
r21629 r21664 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 -
trunk/wp-login.php
r21507 r21664 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 } … … 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 -
trunk/wp-signup.php
r20556 r21664 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 {
Note: See TracChangeset
for help on using the changeset viewer.