WordPress.org

Make WordPress Core

Ticket #36201: wp-admin-url-36201.patch

File wp-admin-url-36201.patch, 2.0 KB (added by kwhat, 15 months ago)

Updated patch, please apply!

  • src/wp-admin/includes/class-wp-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
    index 021547fd18..e5cc4b3bb8 100644
    a b class WP_List_Table { 
    795795                $current              = $this->get_pagenum();
    796796                $removable_query_args = wp_removable_query_args();
    797797
    798                 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     798                $siteurl = get_option('siteurl');
     799                $current_url = parse_url($siteurl, PHP_URL_SCHEME) . '://' . parse_url($siteurl, PHP_URL_HOST) . $_SERVER['REQUEST_URI'];
    799800
    800801                $current_url = remove_query_arg( $removable_query_args, $current_url );
    801802
    class WP_List_Table { 
    10821083        public function print_column_headers( $with_id = true ) {
    10831084                list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
    10841085
    1085                 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     1086                $siteurl = get_option('siteurl');
     1087                $current_url = parse_url($siteurl, PHP_URL_SCHEME) . '://' . parse_url($siteurl, PHP_URL_HOST) . $_SERVER['REQUEST_URI'];
    10861088                $current_url = remove_query_arg( 'paged', $current_url );
    10871089
    10881090                if ( isset( $_GET['orderby'] ) ) {
  • src/wp-admin/includes/misc.php

    diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
    index 5c5560d60f..5b57bd61ae 100644
    a b function wp_admin_canonical_url() { 
    11771177        }
    11781178
    11791179        // Ensure we're using an absolute URL.
    1180         $current_url  = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     1180        $siteurl = get_option('siteurl');
     1181        $current_url = parse_url($siteurl, PHP_URL_SCHEME) . '://' . parse_url($siteurl, PHP_URL_HOST) . $_SERVER['REQUEST_URI'];
    11811182        $filtered_url = remove_query_arg( $removable_query_args, $current_url );
    11821183        ?>
    11831184        <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" />