Making WordPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#2821 closed defect (bug) (fixed)

Plugin Directory: Plugin slug should be Latin Characters Only

Reported by: ipstenu's profile Ipstenu Owned by: tellyworth's profile tellyworth
Milestone: Plugin Directory v3.0 Priority: normal
Component: Plugin Directory Keywords: has-patch has-screenshots
Cc:

Description

As much as it pains me to say this, due to integration with SVN and other tools, it's safest to keep our slugs using non-accented characters (à or ñ or œ and so on).

We can manually fix it but we should automate that.

Attachments (3)

2821.patch (821 bytes) - added by SergeyBiryukov 7 years ago.
2821.PNG (26.3 KB) - added by SergeyBiryukov 7 years ago.
2821.2.patch (1.5 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (10)

@SergeyBiryukov
7 years ago

#1 @SergeyBiryukov
7 years ago

  • Keywords has-patch added; needs-patch removed

2821.patch replaces sanitize_title_with_dashes() with sanitize_title(), which includes remove_accents().

This doesn't cover Cyrillic/Arabic/Hebrew/Japanese characters — do we need to block those as well, or removing accents would be good enough for now?

#2 @Ipstenu
7 years ago

We need to block those too :( It does weird things if we use non ... boring English (I'm sleepy and I can't remember the right word for non-accented English characters)

@SergeyBiryukov
7 years ago

#3 @SergeyBiryukov
7 years ago

  • Keywords has-screenshots added

In 2821.2.patch:

  • Run the plugin name through remove_accents().
  • Strip any non-ASCII characters.
  • Run the rest through sanitize_title_with_dashes().

If the slug turns out to be empty, an error message is displayed:

The plugin has an unsupported name. Plugin names can only contain latin letters (A-z), numbers, spaces, and hyphens. Please change the Plugin Name: line in your main plugin file and upload it again.

Suggestions for better text welcome :)

Last edited 7 years ago by SergeyBiryukov (previous) (diff)

#4 @Ipstenu
7 years ago

I think that's good to start with. My +1 for you, sir!

#5 @SergeyBiryukov
7 years ago

  • Milestone set to Plugin Directory v3.0

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


7 years ago

#7 @tellyworth
7 years ago

  • Owner set to tellyworth
  • Resolution set to fixed
  • Status changed from new to closed

In 5562:

Plugin directory: strip non-latin characters from plugin slugs on upload. Props @SergeyBiryukov

Fixes #2821

Note: See TracTickets for help on using tickets.