Make WordPress Core

Ticket #53475: 53475.diff

File 53475.diff, 1.8 KB (added by adamsilverstein, 7 months ago)
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 71a0522139..fac25e224c 100644
    function get_allowed_mime_types( $user = null ) { 
    33003300                unset( $t['htm|html'], $t['js'] );
    33013301        }
    33023302
     3303        $supports_webp = false;
     3304        // If the server lacks WebP support, remove it from the list of supported mime types.
     3305        if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
     3306                if ( WP_Image_Editor_Imagick::supports_mime_type( 'image/webp' ) ) {
     3307                        $supports_webp = true;
     3308                }
     3309        } else {
     3310                // GD is the image editor.
     3311                if ( WP_Image_Editor_GD::supports_mime_type( 'image/webp' ) ) {
     3312                        $supports_webp = true;
     3313                }
     3314        }
     3315
     3316        if ( ! $supports_webp ) {
     3317                unset( $t['webp'] );
     3318        }
     3319
    33033320        /**
    33043321         * Filters list of allowed mime types and file extensions.
    33053322         *
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 2e1e6668cd..c7a6963f73 100644
    function wp_default_scripts( $scripts ) { 
    851851                /* translators: %s: File name. */
    852852                'file_exceeds_size_limit'   => __( '%s exceeds the maximum upload size for this site.' ),
    853853                'zero_byte_file'            => __( 'This file is empty. Please try another.' ),
    854                 'invalid_filetype'          => __( 'Sorry, this file type is not permitted for security reasons.' ),
     854                'invalid_filetype'          => __( 'Sorry, this file type is not supported.' ),
    855855                'not_an_image'              => __( 'This file is not an image. Please try another.' ),
    856856                'image_memory_exceeded'     => __( 'Memory exceeded. Please try another smaller file.' ),
    857857                'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),