WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#46587 closed defect (bug) (invalid)

class-wp-list-table.php ignores WP_SITEURL

Reported by: mdirickxwtd Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

WP list table ignores values set in wp_siteurl and returns wrong links. This is disastrous in case of reverse proxies.

This tracked the problem to line 798 and 1082 in wp-admin/includes/class-wp-list-table.php which to me seemed to ignore the wp_siteurl settings:

<?php
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );

Changing it to

<?php
$current_url = set_url_scheme(  wp_guess_url(). $_SERVER['REQUEST_URI'] );

seemed to resolve the issue (on my end). Not sure if this a decent approach though, I'm not familiar to wp code. There might be more logic going on afterwards. I just needed something quick and dirty that works.

Background info

I'm running into this issue as I have a reverse proxy in front of my site. The reverse proxy is accessible at https://wiki.example.com, the actual site is at http://int.ern.al.IP/wiki. With the current approach, a lot of links are structured as http://int.ern.al.IP/wiki/wp-... which breaks the site.

Change History (2)

#1 @mdirickxwtd
8 months ago

  • Resolution set to invalid
  • Status changed from new to closed

#2 @desrosj
8 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.