Make WordPress Core


Ignore:
Timestamp:
05/30/2023 07:44:56 PM (20 months ago)
Author:
johnbillion
Message:

Media: Correct the fallback value passed to the $mimes parameter of wp_check_filetype_and_ext() from _wp_handle_upload(), and update corresponding documentation.

Previously when the mimes element was not specified in the overrides array passed to _wp_handle_upload() it resulted in boolean false being passed to this parameter, which is incorrect. The fallback value should be null.

Props platonkristinin, pkbhatt

Fixes #58349

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r55827 r55872  
    891891    // If you override this, you must provide $ext and $type!!
    892892    $test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true;
    893     $mimes     = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false;
     893    $mimes     = isset( $overrides['mimes'] ) ? $overrides['mimes'] : null;
    894894
    895895    // A correct form post will pass this test.
Note: See TracChangeset for help on using the changeset viewer.