Ticket #25767: remove_scheme.2.diff
File remove_scheme.2.diff, 1.5 KB (added by , 9 years ago) |
---|
-
wp-admin/includes/file.php
79 79 * @return string Full filesystem path to the root of the WordPress installation 80 80 */ 81 81 function get_home_path() { 82 $home = get_option( 'home');83 $siteurl = get_option( 'siteurl');82 $home = remove_url_scheme( get_option( 'home' ) ); 83 $siteurl = remove_url_scheme( get_option( 'siteurl' ) ); 84 84 if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) { 85 85 $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */ 86 86 $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) ); -
wp-includes/link-template.php
2332 2332 } 2333 2333 2334 2334 /** 2335 * Remove the scheme from a URL 2336 * 2337 * @since 3.9.0 2338 * 2339 * @param string $url Absolute url that includes a scheme 2340 * @return string $url URL without its scheme. 2341 */ 2342 function remove_url_scheme( $url ) { 2343 $url = trim( $url ); 2344 if ( substr( $url, 0, 2 ) === '//' ) { 2345 $url = 'http:' . $url; 2346 } 2347 2348 return preg_replace( '#^\w+://#', '', $url ); 2349 } 2350 2351 /** 2335 2352 * Get the URL to the user's dashboard. 2336 2353 * 2337 2354 * If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,