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-admin/includes/file.php

    r51939 r52032  
    932932
    933933        if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) {
    934             return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) );
     934            return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, you are not allowed to upload this file type.' ) ) );
    935935        }
    936936
Note: See TracChangeset for help on using the changeset viewer.