Editor: Check if `mb_strtolower` exists before using it in the font library.

Prevents an error when uploading fonts on certain systems, because the `mbstring` extension can be missing and thus the function may not be available.

Props mujuonly, swissspidy, peterwilsoncc.
Fixes #60823.
See #55603.
Built from https://develop.svn.wordpress.org/trunk@57865


git-svn-id: http://core.svn.wordpress.org/trunk@57366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2024-03-22 14:17:09 +00:00
parent fae0e892b7
commit 24ad060351
2 changed files with 6 additions and 3 deletions

View File

@ -110,8 +110,11 @@ class WP_Font_Utils {
'unicodeRange' => 'U+0-10FFFF',
);
$settings = wp_parse_args( $settings, $defaults );
$font_family = mb_strtolower( $settings['fontFamily'] );
if ( function_exists( 'mb_strtolower' ) ) {
$font_family = mb_strtolower( $settings['fontFamily'] );
} else {
$font_family = strtolower( $settings['fontFamily'] );
}
$font_style = strtolower( $settings['fontStyle'] );
$font_weight = strtolower( $settings['fontWeight'] );
$font_stretch = strtolower( $settings['fontStretch'] );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57864';
$wp_version = '6.6-alpha-57865';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.