Ticket #8593: 8593.2.patch
File 8593.2.patch, 4.5 KB (added by , 12 years ago) |
---|
-
wp-includes/canonical.php
### Eclipse Workspace Patch 1.0 #P wordpress-trunk bare
42 42 43 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 = wp_requested_url(); 48 46 } 49 47 50 48 $original = @parse_url($requested_url); -
wp-includes/functions.php
3596 3596 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 3597 3597 $url = WP_SITEURL; 3598 3598 } else { 3599 $ schema = is_ssl() ? 'https://' : 'http://';3600 $url = preg_replace( '|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);3599 $url = wp_requested_url(); 3600 $url = preg_replace( '|/wp-admin/.*|i', '', $url ); 3601 3601 } 3602 3602 return rtrim($url, '/'); 3603 3603 } 3604 3604 3605 3605 /** 3606 * Get the requested URL of the site 3607 * 3608 * @since 3.2 3609 * @param bool $ssl Optional. Override SSL property of the request, setting it to non-SSL or SSL explicitly 3610 * @return string requested URL 3611 */ 3612 function wp_requested_url( $ssl = null ) { 3613 $ssl = ( null === $ssl ) ? is_ssl() : $ssl; 3614 $scheme = $ssl ? 'https' : 'http'; 3615 $default_port = $ssl ? '443' : '80'; 3616 list( $host, $port ) = explode( ':', $_SERVER['HTTP_HOST'] . ":$default_port" ); 3617 $host .= ( $port == $default_port ? '' : ":$port" ); 3618 return "$scheme://$host" . $_SERVER['REQUEST_URI']; 3619 } 3620 3621 /** 3606 3622 * Suspend cache invalidation. 3607 3623 * 3608 3624 * Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations -
wp-admin/setup-config.php
194 194 * @ignore 195 195 */ 196 196 function get_bloginfo() { 197 return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ));197 return str_replace( wp_requested_url(), '/wp-admin/setup-config.php', '' ); 198 198 } 199 199 /**#@-*/ 200 200 $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); -
wp-login.php
13 13 14 14 // Redirect to https login if forced to use SSL 15 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 } 16 wp_redirect( wp_requested_url( true ) ); 17 exit(); 23 18 } 24 19 25 20 /** … … 357 352 if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) 358 353 $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); 359 354 360 $schema = is_ssl() ? 'https://' : 'http://'; 361 if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') ) 362 update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); 355 $new_siteurl = dirname( wp_requested_url() ); 356 if ( $new_siteurl != get_option('siteurl') ) 357 update_option('siteurl', $new_siteurl ); 358 unset($new_siteurl); 363 359 } 364 360 365 361 //Set a cookie now to see if they are supported by the browser. -
wp-admin/includes/class-wp-list-table.php
475 475 476 476 $current = $this->get_pagenum(); 477 477 478 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];478 $current_url = wp_requested_url(); 479 479 480 480 $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url ); 481 481 … … 631 631 632 632 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 633 633 634 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];634 $current_url = wp_requested_url(); 635 635 $current_url = remove_query_arg( 'paged', $current_url ); 636 636 637 637 if ( isset( $_GET['orderby'] ) )