Opened 11 years ago
Closed 11 years ago
#34397 closed defect (bug) (wontfix)
Microsoft-IIS detection in the wp_fix_server_vars() function
| Reported by: | 3sq | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
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)
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Replying to 3sq:
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
$_SERVERquery 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.