WordPress.org

Make WordPress Core

Changeset 39891


Ignore:
Timestamp:
01/12/17 06:28:32 (5 months ago)
Author:
SergeyBiryukov
Message:

Media: Use a consistent error message for file type errors on uploading.

Props pavelevap, jackreichert.
Fixes #33242.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r39850 r39891  
    21402140    $wp_filetype = wp_check_filetype( $name ); 
    21412141    if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) 
    2142         return array( 'error' => __( 'Invalid file type' ) ); 
     2142        return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) ); 
    21432143 
    21442144    $upload = wp_upload_dir( $time ); 
  • trunk/src/wp-includes/script-loader.php

    r39684 r39891  
    281281        'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'), 
    282282        'zero_byte_file' => __('This file is empty. Please try another.'), 
    283         'invalid_filetype' => __('This file type is not allowed. Please try another.'), 
     283        'invalid_filetype' => __('Sorry, this file type is not permitted for security reasons.'), 
    284284        'not_an_image' => __('This file is not an image. Please try another.'), 
    285285        'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'), 
Note: See TracChangeset for help on using the changeset viewer.