[wp-trac] [WordPress Trac] #20849: 'ABSPATH' Invalid with Windows Servers

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 6 14:11:03 UTC 2012


#20849: 'ABSPATH' Invalid with Windows Servers
--------------------------+----------------------
 Reporter:  admintiger    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Filesystem    |     Version:  3.4
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------
Changes (by nacin):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Replying to [comment:6 GaryJ]:
 > "WordPress standard of /" instead of the PHP DIRECTORY_SEPARATOR
 constant - the very thing it was created for.

 That's not accurate. Building paths with DIRECTORY_SEPARATOR is extra
 characters, wordy, annoying, and also unnecessary.

 A forward slash works fine on Windows, even when mixed with backwards
 slashes, such as in the case of `C:\public\www.example.com/wp-
 includes/shortcodes.php`. This is not an invalid path. It is a perfectly
 valid Windows path.

 If DIRECTORY_SEPARATOR is not needed to build platform-independent paths,
 what is it good for?  It is only really useful when you need to do
 operations against a path provided to you by the system, such as taking
 `__FILE__` and exploding it by DIRECTORY_SEPARATOR. In some cases, it is
 still just easier to standardize on / with a find-replace first, depending
 on what you are trying to do.

 If you don't believe me, that's fine, but there are comments and posts
 scattered about the web that will echo the same thing.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20849#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list