Skip to content
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

Font Library: PHP 8.1.12 check for woff/woff2 mime types #6110

Conversation

hellofromtonya
Copy link
Contributor

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:

Co-authored-by: costdev costdev@git.wordpress.org

Trac ticket: https://core.trac.wordpress.org/ticket/60536


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

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.
Copy link

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props hellofromtonya.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@costdev costdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this @hellofromtonya! Looks good to go!

@hellofromtonya
Copy link
Contributor Author

@WordPress WordPress deleted a comment from sofialeena Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants