Make WordPress Core


Ignore:
Timestamp:
02/20/2024 07:09:43 AM (3 months ago)
Author:
youknowriad
Message:

Editor: Format and sanitize font family names according the CSS spec.

This fixes two bugs in the font library.

  • Fonts using special characters were not being rendered properly in the frontend.
  • Allows the ability to use generic() in font family names.

Props mmaattiiaass, nithins53, kafleg, vivekawsm, swissspidy, audrasjb.
Fixes #60537.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php

    r57548 r57657  
    682682        $settings = array(
    683683            'name'       => 'Open Sans',
    684             'fontFamily' => '"Open Sans, "Noto Sans", sans-serif',
     684            'fontFamily' => 'Open Sans, "Noto Sans", sans-serif',
    685685            'preview'    => 'https://s.w.org/images/fonts/16.9/previews/open-sans/open-sans-400-normal.svg',
    686686        );
     
    701701            'name'       => $settings['name'],
    702702            'slug'       => 'open-sans-2',
    703             'fontFamily' => $settings['fontFamily'],
     703            'fontFamily' => '"Open Sans", "Noto Sans", sans-serif',
    704704            'preview'    => $settings['preview'],
    705705        );
Note: See TracChangeset for help on using the changeset viewer.