Make WordPress Core

Changeset 57869


Ignore:
Timestamp:
03/23/2024 09:15:28 AM (9 months ago)
Author:
swissspidy
Message:

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.

Location:
branches/6.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/wp-includes/fonts/class-wp-font-utils.php

    r57657 r57869  
    111111        );
    112112        $settings = wp_parse_args( $settings, $defaults );
    113 
    114         $font_family   = mb_strtolower( $settings['fontFamily'] );
     113        if ( function_exists( 'mb_strtolower' ) ) {
     114            $font_family = mb_strtolower( $settings['fontFamily'] );
     115        } else {
     116            $font_family = strtolower( $settings['fontFamily'] );
     117        }
    115118        $font_style    = strtolower( $settings['fontStyle'] );
    116119        $font_weight   = strtolower( $settings['fontWeight'] );
Note: See TracChangeset for help on using the changeset viewer.