Opened 8 years ago
Closed 8 years ago
#3011 closed defect (bug) (fixed)
Plugin Directory: Disallow changing the slug to an existing plugin's slug
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Plugin Directory v3.0 | Priority: | high |
Component: | Plugin Directory | Keywords: | has-patch |
Cc: |
Description (last modified by )
Background: discussion in #meta with @otto42 and @ipstenu.
Under some circumstances, it's possible to have plugins with duplicate slugs:
- Open a plugin with a
new
(Pending Initial Review) status for editing. - Change the slug to another existing plugin's slug.
- Click "Mark as Pending".
- There are now two plugins with the same slug. Whichever one is updated next will get a
-2
appended to its slug, causing some confusion.
Changing the slug to another existing plugin's slug should be disallowed.
Some technical details: this happens because wp_unique_post_slug() bails early when dealing with a pending post. Both get_sample_permalink() and wp_ajax_inline_save() have a hack to prevent that by faking a'publish'
status, but get_sample_permalink()
does not run on Edit Plugin screen, so some additional checks are needed.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
3011.patch shows an error when trying to use an existing plugin's slug, either on Edit Plugin screen or via Quick Edit.