[wp-trac] [WordPress Trac] #36201: Admin Pagination URLs Use Wrong Hostname

WordPress Trac noreply at wordpress.org
Thu May 10 09:03:34 UTC 2018

#36201: Admin Pagination URLs Use Wrong Hostname
 Reporter:  grimmdude                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:
  feedback close                                 |

Comment (by viliusl):

 As stated above, this is rare problem, but still happens if WP is used
 with proxy.

 And fix is easy: take host from DB, not form $_SERVER (WP already doing
 it, sadly, not everywhere).


 $siteurl = get_option('siteurl');
 $current_url = parse_url($siteurl, PHP_URL_SCHEME) . '://' .
 parse_url($siteurl, PHP_URL_HOST) . $_SERVER['REQUEST_URI'];

 p.s. similar situation with sorting:

Ticket URL: <https://core.trac.wordpress.org/ticket/36201#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list