Make WordPress Core


Ignore:
Timestamp:
11/07/2021 11:28:48 PM (3 years ago)
Author:
antpb
Message:

Media: Remove security messaging in media upload failures.

Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.

File:
1 edited

Legend:

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

    r51957 r52032  
    28092809    $wp_filetype = wp_check_filetype( $name );
    28102810    if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) {
    2811         return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) );
     2811        return array( 'error' => __( 'Sorry, you are not allowed to upload this file type.' ) );
    28122812    }
    28132813
Note: See TracChangeset for help on using the changeset viewer.