[wp-trac] [WordPress Trac] #40070: Cannot remove theme with Javascript if folder name contains periods

WordPress Trac noreply at wordpress.org
Mon May 22 00:05:49 UTC 2017


#40070: Cannot remove theme with Javascript if folder name contains periods
--------------------------+-----------------------------
 Reporter:  svanlooy      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Themes        |     Version:  4.7.3
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+-----------------------------

Comment (by dd32):

 Replying to [comment:9 obenland]:
 > Unfortunately this is not limited to `.`, the installer doesn't really
 strip out any non-word characters.
 >
 > @dd32 How would you suggest we sanitize these slugs?
 `sanitize_textfield()`?

 I'm not sure you should convert it to a slug at all - slugification isn't
 designed to be used on arbitrary data like this, and causes this exact
 scenario.

 I'd suggest it should return the JS-escaped folder name instead, and
 should be handled appropriately on the client side - that may mean that
 items need an extra attribute such as this:
 `class="plugin-{$slug_attempt_at_folder" data-
 folder="{$escaped_foldername}"` for filter/reference purposes.

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


More information about the wp-trac mailing list