Making WordPress.org


Ignore:
Timestamp:
10/13/2017 11:31:06 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: When searching for the main plugin file on upload, limit recursion depth to 1 level.

Scanning the deeper levels can grab the wrong data, e.g. if there's a sub-plugin with headers, it may be scanned instead of the main one.

Fixes #2804.

File:
1 edited

Legend:

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

    r5841 r6026  
    6161        $this->plugin_dir = Filesystem::unzip( $zip_file );
    6262
    63         $plugin_files = Filesystem::list_files( $this->plugin_dir, true /* Recursive */, '!\.php$!i' );
     63        $plugin_files = Filesystem::list_files( $this->plugin_dir, true /* Recursive */, '!\.php$!i', 1 /* Depth */ );
    6464        foreach ( $plugin_files as $plugin_file ) {
    6565            $plugin_data = get_plugin_data( $plugin_file, false, false ); // No markup/translation needed.
Note: See TracChangeset for help on using the changeset viewer.