-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct the PHP version check for woff
and woff2
MIME types.
#59015
Correct the PHP version check for woff
and woff2
MIME types.
#59015
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed, PHP 8.1.12 is the version (not 8.1.00) that fixed the woff and woff2 file mime types. The changes are necessary.
Excellent catch @costdev. Yes indeed, the version should be 8.1.12, as it's the first version that fixed the woff/woff2 mime types. Approved the PR ✅ Let's get this change sync'd back into Core too. Want to open a PR for it? |
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: * PHP-src: finfo returns wrong mime type for woff/woff2 files php/php-src#8805 * PHP 8.1.12 changelog https://www.php.net/ChangeLog-8.php#8.1.12 * Tests: Adjust the expected mime type for WOFF fonts on PHP 8.1.12+ WordPress@5eefddf * Gutenberg PR 59015 WordPress/gutenberg#59015 Props @costdev.
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: * [php/php-src#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]. * [WordPress/gutenberg#59015 Gutenberg PR 59015]. Follow-up to [57539]. Props costdev, kafleg, hellofromTonya. Fixes 60536. git-svn-id: https://develop.svn.wordpress.org/trunk@57632 602fd350-edb4-49c9-b593-d223f7449a82
Fix synchronized into Core via https://core.trac.wordpress.org/changeset/57632 ✅ |
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: * [php/php-src#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]. * [WordPress/gutenberg#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: https://core.svn.wordpress.org/trunk@57133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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: * [php/php-src#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]. * [WordPress/gutenberg#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
What?
In #58997, a bug was reported where fonts could not be installed in PHP 8.1.0 through 8.1.11 due to incorrect MIME type assignment. This PR corrects a PHP version check to resolve the issue.
Why?
While
WP_Font_Utils::get_allowed_font_mime_types()
conditionally sets the MIME type forwoff
andwoff2
, it incorrectly checks against PHP 8.1.0. The MIME type change did not occur until PHP 8.1.12.See:
How?
This changes the checked
PHP_VERSION_ID
from80100
to80112
when choosing the correct MIME type forwoff
andwoff2
.Testing Instructions