Make WordPress Core

Ticket #53626: 53626.3.diff

File 53626.3.diff, 6.1 KB (added by peterwilsoncc, 3 years ago)
  • src/wp-admin/includes/file.php

    diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
    index 50345c6331..cc4447e7da 100644
    a b function _wp_handle_upload( &$file, $overrides, $time, $action ) { 
    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 ) {
  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index aa507bb004..8d0b1881c7 100644
    a b function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { 
    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 );
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 71c56192ee..3aef40ea6d 100644
    a b function wp_default_scripts( $scripts ) { 
    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.' ),
  • tests/qunit/index.html

    diff --git a/tests/qunit/index.html b/tests/qunit/index.html
    index dd3fb68224..ffbfd9f3f1 100644
    a b  
    4040                </script>
    4141                <script src="../../build/wp-includes/js/utils.js"></script>
    4242                <script>
    43                         window.pluploadL10n = {"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":"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.","default_error":"An error occurred in the upload. Please try again later.","missing_upload_url":"There was a configuration error. Please contact the server administrator.","upload_limit_exceeded":"You may only upload 1 file.","http_error":"HTTP error.","upload_failed":"Upload failed.","big_upload_failed":"Please try uploading this file with the %1$sbrowser uploader%2$s.","big_upload_queued":"%s exceeds the maximum upload size for the multi-file uploader when used in your browser.","io_error":"IO error.","security_error":"Security error.","file_cancelled":"File canceled.","upload_stopped":"Upload stopped.","dismiss":"Dismiss","crunching":"Crunching\u2026","deleted":"moved to the Trash.","error_uploading":"\u201c%s\u201d has failed to upload."};
     43                        window.pluploadL10n = {"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":"Sorry, you are not allowed to upload this file type.","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.","default_error":"An error occurred in the upload. Please try again later.","missing_upload_url":"There was a configuration error. Please contact the server administrator.","upload_limit_exceeded":"You may only upload 1 file.","http_error":"HTTP error.","upload_failed":"Upload failed.","big_upload_failed":"Please try uploading this file with the %1$sbrowser uploader%2$s.","big_upload_queued":"%s exceeds the maximum upload size for the multi-file uploader when used in your browser.","io_error":"IO error.","security_error":"Security error.","file_cancelled":"File canceled.","upload_stopped":"Upload stopped.","dismiss":"Dismiss","crunching":"Crunching\u2026","deleted":"moved to the Trash.","error_uploading":"\u201c%s\u201d has failed to upload."};
    4444                        window._wpPluploadSettings = {"defaults":{"runtimes":"html5,flash,silverlight,html4","file_data_name":"async-upload","url":"\/wp-admin\/async-upload.php","flash_swf_url":"http:\/\/src.wordpress-develop.dev\/wp-includes\/js\/plupload\/plupload.flash.swf","silverlight_xap_url":"http:\/\/src.wordpress-develop.dev\/wp-includes\/js\/plupload\/plupload.silverlight.xap","filters":{"max_file_size":"2097152b","mime_types":[{"extensions":"jpg,jpeg,jpe,gif,png,bmp,tiff,tif,ico,asf,asx,wmv,wmx,wm,avi,divx,flv,mov,qt,mpeg,mpg,mpe,mp4,m4v,ogv,webm,mkv,3gp,3gpp,3g2,3gp2,txt,asc,c,cc,h,srt,csv,tsv,ics,rtx,css,vtt,dfxp,mp3,m4a,m4b,ra,ram,wav,ogg,oga,mid,midi,wma,wax,mka,rtf,js,pdf,class,tar,zip,gz,gzip,rar,7z,psd,xcf,doc,pot,pps,ppt,wri,xla,xls,xlt,xlw,mdb,mpp,docx,docm,dotx,dotm,xlsx,xlsm,xlsb,xltx,xltm,xlam,pptx,pptm,ppsx,ppsm,potx,potm,ppam,sldx,sldm,onetoc,onetoc2,onetmp,onepkg,oxps,xps,odt,odp,ods,odg,odc,odb,odf,wp,wpd,key,numbers,pages"}]},"multipart_params":{"action":"upload-attachment","_wpnonce":"87fa5740b8"}},"browser":{"mobile":false,"supported":true},"limitExceeded":false};
    4545                </script>
    4646                <script src="../../build/wp-includes/js/plupload/wp-plupload.js"></script>