Make WordPress Core

Ticket #53626: 53626.2.diff

File 53626.2.diff, 2.1 KB (added by iluy, 3 years ago)

In case we decide to go with @peterwilsoncc 's suggestion... I went ahead and created a patch. Hope I'm not cluttering this ticket.

  • wp-admin/includes/file.php

     
    931931                }
    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
    937937                if ( ! $type ) {
  • wp-includes/functions.php

     
    27932793
    27942794        $wp_filetype = wp_check_filetype( $name );
    27952795        if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) {
    2796                 return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) );
     2796                return array( 'error' => __( 'Sorry, you are not allowed to upload this file type.' ) );
    27972797        }
    27982798
    27992799        $upload = wp_upload_dir( $time );
  • wp-includes/script-loader.php

     
    866866                /* translators: %s: File name. */
    867867                'file_exceeds_size_limit'   => __( '%s exceeds the maximum upload size for this site.' ),
    868868                'zero_byte_file'            => __( 'This file is empty. Please try another.' ),
    869                 'invalid_filetype'          => __( 'Sorry, this file type is not permitted for security reasons.' ),
     869                'invalid_filetype'          => __( 'Sorry, you are not allowed to upload this file type.' ),
    870870                'not_an_image'              => __( 'This file is not an image. Please try another.' ),
    871871                'image_memory_exceeded'     => __( 'Memory exceeded. Please try another smaller file.' ),
    872872                'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),