[wp-trac] [WordPress Trac] #44654: Use DIRECTORY_SEPARATOR instead of always using forward slash

WordPress Trac noreply at wordpress.org
Fri Jul 27 05:39:19 UTC 2018


#44654: Use DIRECTORY_SEPARATOR instead of always using forward slash
--------------------------+------------------------------
 Reporter:  mnelson4      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------
Changes (by mnelson4):

 * keywords:   => close


Comment:

 Oh, I actually just learned PHP is ok with using forward slashes, even
 when ran from Windows (see https://stackoverflow.com/questions/3554817
 /using-directory-separator-in-file-exists-on-windows#3554966). My problems
 were just in unit tests that incorrectly expected the operating system's
 directory separator to be used.
 I ranted on this topic quite a bit on my blog:
 https://cmljnelson.wordpress.com/2018/07/26/which-way-do-your-slashes-
 face/
 But basically, while I'd prefer to use DIRECTORY_SEPARATOR, I think the
 die has been cast, WordPress uses forward slashes in PHP code, even for
 filepaths. So I think it's ok to just close this.

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


More information about the wp-trac mailing list