Making WordPress.org

Changeset 9648


Ignore:
Timestamp:
03/31/2020 03:48:38 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Require a license be specified in the readme.txt.

Props Ipstenu.
Fixes #4719.
See #1944.

File:
1 edited

Legend:

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

    r9613 r9648  
    237237        }
    238238        $readme = new Parser( $readme );
     239
     240        // Check for a readme license.
     241        if ( $readme->license ) {
     242            $error = __( 'Error: No license defined.', 'wporg-plugins' );
     243
     244            return new \WP_Error( 'no_license', $error . ' ' . sprintf(
     245                /* translators: 1: readme.txt */
     246                __( 'Your plugin has no license declared. Please update your %1$s with a GPLv2 (or later) compatible license.', 'wporg-plugins' ),
     247                '<code>readme.txt</code>'
     248            ) );
     249        }
    239250
    240251        // Pass it through Plugin Check and see how great this plugin really is.
Note: See TracChangeset for help on using the changeset viewer.