Making WordPress.org

Changeset 5416


Ignore:
Timestamp:
04/26/2017 10:46:56 PM (9 years ago)
Author:
tellyworth
Message:

Plugin directory: reject plugin upload on duplicate slug.

Fixes #2787

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r5401 r5416  
    9797                $plugin_post = Plugin_Directory::get_plugin_post( $this->plugin_slug );
    9898
    99                 // Is there already a plugin by a different author?
     99                // Is there already a plugin with the same slug by a different author?
    100100                if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) {
    101101                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    … …  
    106106                }
    107107
    108                 // Check the plugin can accept uploads (New submissions, or pending further review).
    109                 if ( $plugin_post && ! in_array( $plugin_post->post_status, array( 'new', 'pending' ) ) ) {
     108                // Is there already a plugin with the same slug by the same author?
     109                if ( $plugin_post ) {
    110110                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    111111                        return sprintf( __( 'There is already a plugin called %1$s. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
Note: See TracChangeset for help on using the changeset viewer.