Making WordPress.org

Changeset 12534


Ignore:
Timestamp:
04/12/2023 05:32:20 AM (12 months ago)
Author:
dd32
Message:

Plugin Directory: When a plugin has an empty or malformed Requires Plugins header, don't store empty slug keys.

See #6921.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r12533 r12534  
    243243
    244244        // Validate whether the dependencies are met by WordPress.org-hosted plugins.
    245         $requires_plugins       = array_map( 'trim', explode( ',', $headers->RequiresPlugins ) );
     245        $requires_plugins       = array_filter( array_map( 'trim', explode( ',', $headers->RequiresPlugins ) ) );
    246246        $requires_plugins_unmet = false;
    247247        foreach ( $requires_plugins as $requires_plugin_slug ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r12533 r12534  
    378378                    'header_textdomain'        => $this->plugin['TextDomain'],
    379379                    'header_description'       => $this->plugin['Description'],
    380                     'requires_plugins'         => array_map( 'trim', explode( ',', $this->plugin['RequiresPlugins'] ) ),
     380                    'requires_plugins'         => array_filter( array_map( 'trim', explode( ',', $this->plugin['RequiresPlugins'] ) ) ),
    381381                    'assets_screenshots'       => array(),
    382382                    'assets_icons'             => array(),
Note: See TracChangeset for help on using the changeset viewer.