From 11d81ecc7cdf9542e78a620ea76b337e14729ee1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 12 Jan 2017 06:29:43 +0000 Subject: [PATCH] Media: Use a consistent error message for file type errors on uploading. Props pavelevap, jackreichert. Fixes #33242. Built from https://develop.svn.wordpress.org/trunk@39891 git-svn-id: http://core.svn.wordpress.org/trunk@39828 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2ee2be8a90..00f9d264b9 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2139,7 +2139,7 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { $wp_filetype = wp_check_filetype( $name ); if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) - return array( 'error' => __( 'Invalid file type' ) ); + return array( 'error' => __( 'Sorry, this file type is not permitted for security reasons.' ) ); $upload = wp_upload_dir( $time ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b9b2bdbcac..7c571070f6 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -280,7 +280,7 @@ function wp_default_scripts( &$scripts ) { 'queue_limit_exceeded' => __('You have attempted to queue too many files.'), 'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'), 'zero_byte_file' => __('This file is empty. Please try another.'), - 'invalid_filetype' => __('This file type is not allowed. Please try another.'), + 'invalid_filetype' => __('Sorry, this file type is not permitted for security reasons.'), 'not_an_image' => __('This file is not an image. Please try another.'), 'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'), 'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'), diff --git a/wp-includes/version.php b/wp-includes/version.php index 989219245c..76d1bf3257 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39890'; +$wp_version = '4.8-alpha-39891'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.