WordPress.org

Make WordPress Core

Opened 18 months ago

Closed 7 months ago

#22209 closed enhancement (fixed)

Simplify logic to generate home path when parsing request

Reported by: evansolomon Owned by: nacin
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch
Focuses: Cc:

Description

In WP::parse_request() we go through a few steps to generate the $home_path variable. Since we now require PHP 5.2, we can use parse_url()'s second argument to get the path directly.

Attachments (1)

22209.diff (724 bytes) - added by evansolomon 18 months ago.

Download all attachments as: .zip

Change History (4)

evansolomon18 months ago

comment:1 scribu18 months ago

That whole area could use some cleanup.

Like, replacing this:

$req_uri_array = explode('?', $req_uri);
$req_uri = $req_uri_array[0];

with this:

list( $req_uri ) = explode('?', $req_uri);

or maybe even using parse_str().

Version 1, edited 18 months ago by scribu (previous) (next) (diff)

comment:2 wonderboymusic8 months ago

  • Milestone changed from Awaiting Review to 3.7

Patch still applies - more cleanup code be done, but this works

comment:3 nacin7 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 25617:

Clean up the path calculations in wp::parse_request().

props evansolomon for initial cleanup.
fixes #22209.

Note: See TracTickets for help on using tickets.