Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15598 closed enhancement (worksforme)

Use DIRECTORY_SEPARATOR for file paths instead of '/'

Reported by: jazzmind's profile jazzmind Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: General Keywords: needs-patch
Focuses: Cc:

Description

Unix directory path separators ('/') are hardcoded in throughout theme.php and perhaps other files. As a result, when running wordpress off a Windows system and using alternative theme directories (via register_theme_directory()) a "theme broken" error is thrown because the code can't find files within the theme path.

If the same theme is moved into the normal themes directory, everything works fine. If the code is run on a unix system, everything also works fine.

Change History (5)

#1 @alex-ye
13 years ago

  • Keywords DIRECTORY_SEPARATOR added

#2 @Denis-de-Bernardy
13 years ago

  • Component changed from Themes to General
  • Keywords needs-patch added; DIRECTORY_SEPARATOR removed
  • Milestone changed from Awaiting Review to Future Release
  • Severity changed from major to normal

#3 @Denis-de-Bernardy
13 years ago

  • Type changed from defect (bug) to enhancement

#4 @scribu
13 years ago

An alternative solution would be to make the register_theme_directory() and related functions check both / and \.

#5 @dd32
13 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Using DIRECTORY_SEPERATOR clutters the code to me IMO, Using / is so much simpler given it's supported on both Windows and Unix systems.

We use str_replace('\\', '/'.. quite often in functions such as register_activation_hook

If there is anywhere that does not work well with Windows filepaths, please file a bug report for the individual issue.

Note: See TracTickets for help on using tickets.