Make WordPress Core

Changeset 57632


Ignore:
Timestamp:
02/14/2024 05:26:25 PM (2 months ago)
Author:
hellofromTonya
Message:

Editor: Check PHP 8.1.12 for woff/woff2 mime types in WP_Font_Utils.

Fixes a bug where fonts could not be installed in PHP 8.1.0 through 8.1.11 due to incorrect MIME type assignment.

While WP_Font_Utils::get_allowed_font_mime_types() conditionally sets the MIME type for woff and woff2, it incorrectly checks against PHP 8.1.0. The MIME type change did not occur until PHP 8.1.12.

References:

Follow-up to [57539].

Props costdev, kafleg, hellofromTonya.
Fixes 60536.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/fonts/class-wp-font-utils.php

    r57567 r57632  
    232232            'otf'   => 'application/vnd.ms-opentype',
    233233            'ttf'   => PHP_VERSION_ID >= 70400 ? 'font/sfnt' : $php_7_ttf_mime_type,
    234             'woff'  => PHP_VERSION_ID >= 80100 ? 'font/woff' : 'application/font-woff',
    235             'woff2' => PHP_VERSION_ID >= 80100 ? 'font/woff2' : 'application/font-woff2',
     234            'woff'  => PHP_VERSION_ID >= 80112 ? 'font/woff' : 'application/font-woff',
     235            'woff2' => PHP_VERSION_ID >= 80112 ? 'font/woff2' : 'application/font-woff2',
    236236        );
    237237    }
Note: See TracChangeset for help on using the changeset viewer.