[wp-trac] [WordPress Trac] #54596: Block theme with period in name causes blank editor

WordPress Trac noreply at wordpress.org
Tue Dec 21 04:12:20 UTC 2021


#54596: Block theme with period in name causes blank editor
-----------------------------------------------+---------------------------
 Reporter:  mkaz                               |       Owner:
                                               |  hellofromTonya
     Type:  defect (bug)                       |      Status:  closed
 Priority:  normal                             |   Milestone:  5.9
Component:  REST API                           |     Version:  trunk
 Severity:  normal                             |  Resolution:  fixed
 Keywords:  has-testing-info has-patch commit  |     Focuses:
-----------------------------------------------+---------------------------
Changes (by hellofromTonya):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52399" 52399]:
 {{{
 #!CommitTicketReference repository="" revision="52399"
 REST API: Support `.` in theme directory names in
 `WP_REST_Global_Styles_Controller`, `WP_REST_Templates_Controller`, and
 `WP_REST_Themes_Controller`.

 Regex changes from [52376] are reverted to restore the original regex
 patterns. Why? [52376] used an include characters pattern, which was too
 limiting. It did not account for localized characters, such as `é`, or
 other valid directory name characters.

 The original theme directory regex pattern, i.e. `[^.\/]+(?:\/[^.\/]+)?`
 excluded the period `.` character. Removing the `.` character resolves the
 reported issue by allowing matching for `themes/theme-dirname-1.0/` or
 `themes/<subdirname>/theme-dirname-1.0/`.

 As the pattern used an exclude approach, all characters are valid for
 matching except for `/`. However, not all characters are cross-platform
 valid for directory names. For example, the characters `/:<>*?"|` are not
 valid on Windows OS. The pattern now excludes those characters.

 The theme's directory (or subdirectory) name pattern matching is now used
 in `WP_REST_Global_Styles_Controller`, `WP_REST_Templates_Controller`, and
 `WP_REST_Themes_Controller`.

 Follow-up to [51003], [52051], [52275], [52376].

 Props costdev, hellofromTonya, spacedmonkey, TimothyBlynJacobs,
 bijayyadav, kafleg.
 Fixes #54596.
 }}}

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


More information about the wp-trac mailing list