Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#34397 closed defect (bug) (wontfix)

Microsoft-IIS detection in the wp_fix_server_vars() function

Reported by: 3sq Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description

We spoof our Apache version as IIS (just to be difficult). However this means that on line 55 of wp-includes/load.php it is detected as IIS when it is not.

The issue occurs on line 79 when the QUERY_STRING var is appended to the REQUEST_URI which already has the query string in it. (I assume on IIS this is not the case).

Replacing line 78 with the following uses parse_url() to check that the REQUEST_URI param does not actually have any query vars before appending them.

if ( ! empty( $_SERVER['QUERY_STRING'] ) && ! parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) {

I think this should solve our issue but also not break the server var changes.

Attachments (1)

34397.diff (496 bytes) - added by swissspidy 6 years ago.

Download all attachments as: .zip

Change History (3)

@swissspidy
6 years ago

#1 @swissspidy
6 years ago

  • Keywords has-patch needs-testing added

#2 in reply to: ↑ description @johnbillion
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to 3sq:

We spoof our Apache version as IIS (just to be difficult). However this means that it is detected as IIS when it is not.

If you're doing something as bizarre as spoofing IIS with Apache then you at least need to have a real IIS server available to determine that you're doing it correctly.

Your server should correctly set the $_SERVER query variables similar to, for example, how a reverse proxy needs to.

Let's not waste our time on self-inflicted issues like this, even as minor as it is.

Note: See TracTickets for help on using tickets.