Making WordPress.org


Ignore:
Timestamp:
08/02/2023 08:11:08 AM (23 months ago)
Author:
dd32
Message:

Plugin Directory: Enforce the maximum zip upload size limit.

This was previously enforced at the server level, however has since changed.

File:
1 edited

Legend:

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

    r12618 r12793  
    6262    public function process_upload() {
    6363        if ( UPLOAD_ERR_OK !== $_FILES['zip_file']['error'] ) {
     64            return new \WP_Error( 'error_upload', __( 'Error in file upload.', 'wporg-plugins' ) );
     65        }
     66
     67        // Validate the maximum upload size.
     68        if ( $_FILEs['zip_file']['size'] > wp_max_upload_size() ) {
    6469            return new \WP_Error( 'error_upload', __( 'Error in file upload.', 'wporg-plugins' ) );
    6570        }
Note: See TracChangeset for help on using the changeset viewer.