[wp-trac] [WordPress Trac] #33265: Normalize drive letter in paths

WordPress Trac noreply at wordpress.org
Tue Aug 4 16:31:30 UTC 2015

#33265: Normalize drive letter in paths
 Reporter:  Rarst        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
 Windows platform mostly treats paths as case-insensitive. However
 WordPress tends to use case-sensitive comparisons for paths.

 Introduction of `wp_normalize_path()` gave an API way to deal with slashes

 Another issue it could handle is consistent case of drive letter.

 Due to varied possible sources of paths (PHP, web server, user
 configuration) mismatch in case of drive letter is relatively common
 (anecdotally I have encountered it multiple times in different contexts),
 ruins case-sensitive paths comparisons, and is hard to notice and debug.

 I would suggest to uppercase drive letter in `wp_normalize_path()`.

 Upper case would be consistent with PHP constants (such as `__FILE__`) and
 historical Windows conventions (as far as I am aware there is no formal
 rule which is "correct" case).

Ticket URL: <https://core.trac.wordpress.org/ticket/33265>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list