Make WordPress Core


Ignore:
Timestamp:
01/30/2024 02:51:40 PM (10 months ago)
Author:
jorbin
Message:

Grouped Backports to the 5.5 branch

  • Install: When populating options, maybe_serialize instead of always serialize.
  • Uploads: Check for and verify ZIP archives.

Merges [57388] and [57389] to the 5.5 branch.

Props costdev, peterwilsoncc, azaozz, tykoted, johnbillion, desrosj, afragen, jorbin, xknown.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-admin/update.php

    r48417 r57400  
    151151
    152152        check_admin_referer( 'plugin-upload' );
     153
     154        if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) {
     155            wp_die( __( 'Only .zip archives may be uploaded.' ) );
     156        }
    153157
    154158        $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
     
    293297
    294298        check_admin_referer( 'theme-upload' );
     299
     300        if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) {
     301            wp_die( __( 'Only .zip archives may be uploaded.' ) );
     302        }
    295303
    296304        $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
Note: See TracChangeset for help on using the changeset viewer.