Making WordPress.org


Ignore:
Timestamp:
06/10/2024 07:45:28 AM (6 months ago)
Author:
dd32
Message:

Plugin Directory: Upload: Specify that the post_author should remain the same when uploading additional ZIPs.

When a plugin is in certain states, the act of a plugin mod uploading an additional ZIP via wp-admin could cause the plugins ownership to change to the plugin mod instead of remaining the same. This prevents that.

File:
1 edited

Legend:

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

    r13650 r13794  
    7979
    8080        $zip_file         = $_FILES['zip_file']['tmp_name'];
    81         $upload_comment   = trim( wp_unslash( $_POST['comment'] ) );
     81        $upload_comment   = trim( wp_unslash( $_POST['comment'] ?? '' ) );
    8282        $has_upload_token = $this->has_valid_upload_token();
    8383        $this->plugin_dir = Filesystem::unzip( $zip_file );
     
    423423        $post_args = array(
    424424            'ID'            => $plugin_post->ID ?? 0,
     425            'post_author'   => $plugin_post->post_author ?? get_current_user_id(),
    425426            'post_title'    => $this->plugin['Name'],
    426427            'post_name'     => $this->plugin_slug,
Note: See TracChangeset for help on using the changeset viewer.