Opened 13 years ago
Closed 12 years ago
#19854 closed defect (bug) (fixed)
themes.php doesn't show themes if using Mac-style CR EOL markers
Reported by: | novasource | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.3.1 |
Component: | Themes | Keywords: | has-patch |
Focuses: | Cc: |
Description
Apparently Macs by default only use CRs to mark end of lines.
If a child theme's style.css file was saved using this, which can happen in Dreamweaver, WordPress won't even show the child theme at wp-admin/themes.php. This has come up at http://wordpress.org/support/topic/child-themes-doesnt-show-up-in-mamp.
If EOL only with CR isn't supported, it would be nice to at least show a warning.
Attachments (3)
Change History (10)
#3
@
13 years ago
This probably also works:
$file_data = str_replace( array( "\r\n", "\r" ), "\n", $file_data );
#5
@
13 years ago
- Summary changed from themes.php doesn't show child themes if using Mac-style CR EOL markers to themes.php doesn't show themes if using Mac-style CR EOL markers
Closed #20248 as duplicate
Note: See
TracTickets for help on using
tickets.
This happens with plugins also.
Tracked it down to the regex in
get_file_data()
. The line start/end metacharacters (^
and$
) require aLF
(\n
) in order to detect the start/end of a line - which of course isn't there if you just haveCR
(\r
). Fix seems relatively simple.