From ffc53f010fd14160192afda16396c889016aa853 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Wed, 14 Feb 2024 17:28:13 +0000 Subject: [PATCH] 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: * [https://github.com/php/php-src/issues/8805 PHP-src: finfo returns wrong mime type for woff/woff2 files]. * [https://www.php.net/ChangeLog-8.php#8.1.12 PHP 8.1.12 changelog]. * Tests: Adjust the expected mime type for WOFF fonts on PHP 8.1.12+ [55463]. * [https://github.com/WordPress/gutenberg/pull/59015 Gutenberg PR 59015]. Follow-up to [57539]. Props costdev, kafleg, hellofromTonya. Fixes 60536. Built from https://develop.svn.wordpress.org/trunk@57632 git-svn-id: http://core.svn.wordpress.org/trunk@57133 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/fonts/class-wp-font-utils.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/fonts/class-wp-font-utils.php b/wp-includes/fonts/class-wp-font-utils.php index 22baff3a5a..e9155b8e59 100644 --- a/wp-includes/fonts/class-wp-font-utils.php +++ b/wp-includes/fonts/class-wp-font-utils.php @@ -231,8 +231,8 @@ class WP_Font_Utils { return array( 'otf' => 'application/vnd.ms-opentype', 'ttf' => PHP_VERSION_ID >= 70400 ? 'font/sfnt' : $php_7_ttf_mime_type, - 'woff' => PHP_VERSION_ID >= 80100 ? 'font/woff' : 'application/font-woff', - 'woff2' => PHP_VERSION_ID >= 80100 ? 'font/woff2' : 'application/font-woff2', + 'woff' => PHP_VERSION_ID >= 80112 ? 'font/woff' : 'application/font-woff', + 'woff2' => PHP_VERSION_ID >= 80112 ? 'font/woff2' : 'application/font-woff2', ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 8a759d10b2..136e5b1cfd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-beta1-57631'; +$wp_version = '6.5-beta1-57632'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.