WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #33498


Ignore:
Timestamp:
08/21/2015 08:53:23 PM (4 years ago)
Author:
swissspidy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33498 – Description

    initial v1  
    22I'm running WordPress on Windows through Webmatrix and IIS Express 8.5 and FastCGI.
    33
    4 This function has a bug that appears only on windows due to its different path formatting and causes the web.config to not be writable on PHP 5.5 (error from DOMDocument::load).
     4This function has a bug that appears only on windows due to its different path formatting and causes the web.config to not be writable on PHP 5.5 (error from` DOMDocument::load`).
    55
    6 WordPress runs addslashes on all $_SERVER/$_GET/$_POST variables which places a burden to remember to stripslashes before using any variable from it.
     6WordPress runs `addslashes` on all `$_SERVER`/`$_GET`/`$_POST` variables which places a burden to remember to stripslashes before using any variable from it.
    77
    8 The get_home_path() function does not do this before using $_SERVER['SCRIPT_FILENAME']. This doesn't cause a problem on Linux because the path format is not modified by addslashes, so it works by coincidence.
     8The get_home_path() function does not do this before using `$_SERVER['SCRIPT_FILENAME']`. This doesn't cause a problem on Linux because the path format is not modified by `addslashes`, so it works by coincidence.
    99
    10 But on Windows, this causes the path to have double slashes (example: C:\\inetpub\\wordpress). Then it is passed to trailingslashit which gives a weird result:
     10But on Windows, this causes the path to have double slashes (example: `C:\\inetpub\\wordpress`). Then it is passed to trailingslashit which gives a weird result:
    1111
    12 C:(doubleslash)inetpub(doubleslash)wordpress(singleslash)
     12`C:\\inetpub\\wordpress\`
    1313
    1414(apologies, trac is messing up the slashes)
    1515
    16 Now, PHP on windows is very tolerant of such paths, but some APIs such as DOMDocument::load (test on PHP 5.5) returns an error and logs that it wasn't able to open the file. This is used by WordPress to save the web.config file when it detects IIS.
     16Now, PHP on windows is very tolerant of such paths, but some APIs such as `DOMDocument::load` (test on PHP 5.5) returns an error and logs that it wasn't able to open the file. This is used by WordPress to save the web.config file when it detects IIS.
    1717
    1818I have attached a patch that fixes this against WordPress 4.3, but I have seen this in 4.2 as well (didn't test with older).