[wp-trac] [WordPress Trac] #27866: Multisite subdirectory install breaks if network path has uppercase letters

WordPress Trac noreply at wordpress.org
Mon Apr 21 21:00:17 UTC 2014


#27866: Multisite subdirectory install breaks if network path has uppercase letters
-------------------------------------------------+-------------------------
 Reporter:  nacin                                |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  3.9.1
Component:  Bootstrap/Load                       |     Version:  3.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  multisite
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by jeremyfelt):

 [https://core.trac.wordpress.org/attachment/ticket/27866/27866.4.diff
 27866.4.diff] removes the `strtolower()` that was added in #26403 **and**
 uses case insensitive checks when matching paths and domains.

 1. The initial reported issue is due to a file system path having mixed
 case. With a case sensitive operating system and web server, this
 (obviously) matters quite a bit and we should not modify the original
 request. For this reason, we should remove `strtolower()` on the path.
 2. It is possible for an operating system or web server to be case
 insensitive (e.g. IIS). While the file system path issue goes away here,
 other issues arise during this path matching logic. A valid request (per
 the OS) for `/pAtH/one/two/` would not match with a defined network path
 of `/PATH/` and would then be pushed down to a block of logic which calls
 `get_site_by_path()` and looks for only one path segment. For this reason,
 we should check if a requested path starts with the current network's path
 using the case insensitive `stripos()`.
 3. For the same reason, an exact request on a case insensitive server for
 `/PATHA/pathb/` would not match a defined path of `/patha/pathb/` and we
 should look for a case insensitive match using `strcasecmp()`.

 The last two points are less severe in that a site will likely be found.
 Any attempt to use more than one path segment may prove to be confusing.

 Additionally. Domains do not have the same case sensitivity issues between
 servers (see [http://www.ietf.org/rfc/rfc4343.txt RFC4343]), though a
 `strcasecmp()` still appears warranted. While one would need to go out of
 their way to define `DOMAIN_CURRENT_SITE` as uppercase, it is possible and
 would have worked fine in 3.8. We do not need to remove the `strtolower()`
 in this case.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27866#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list