From 609157125d9fbd7718c366c5d1d08c758da34957 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 23 Mar 2024 09:17:15 +0000 Subject: [PATCH] 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. Reviewed by jorbin. Merges [57865] to the to the 6.5 branch. Props mujuonly, swissspidy, peterwilsoncc. Fixes #60823. See #55603. Built from https://develop.svn.wordpress.org/branches/6.5@57869 git-svn-id: http://core.svn.wordpress.org/branches/6.5@57370 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/fonts/class-wp-font-utils.php | 7 +++++-- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/fonts/class-wp-font-utils.php b/wp-includes/fonts/class-wp-font-utils.php index 3c2d5057e4..6e91440748 100644 --- a/wp-includes/fonts/class-wp-font-utils.php +++ b/wp-includes/fonts/class-wp-font-utils.php @@ -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'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index f05c9f2bae..aac0da1817 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-RC3-57866'; +$wp_version = '6.5-RC3-57869'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.