[wp-trac] [WordPress Trac] #48099: get_stylesheet_directory() and get_template_directory() are front-slashed even in Windows environment

WordPress Trac noreply at wordpress.org
Sat Oct 19 00:01:06 UTC 2019


#48099: get_stylesheet_directory() and get_template_directory() are front-slashed
even in Windows environment
--------------------------+------------------------
 Reporter:  KestutisIT    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch close =>
 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 Thanks for the ticket!

 [46473] fixes a regression introduced in [45971], which is not the case
 here.

 Using `DIRECTORY_SEPARATOR` in core has been discussed several times
 before, most recently in #28811 and #29726. Since Windows recognizes both
 types of slashes, there is no strong reason for changing this if nothing
 is broken.

 Anywhere in core where a path needs to be compared, `wp_normalize_path()`
 should be used.

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


More information about the wp-trac mailing list