From 24ad06035170e51913123243f2f44ba4f76fd6f5 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 22 Mar 2024 14:17:09 +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. 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 --- 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 51bb22d56d..814a3fa3e4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.