[wp-trac] [WordPress Trac] #63568: WP_Font_Face: Font names that contain single quotes are not wrapped in double quotes

WordPress Trac noreply at wordpress.org
Mon Sep 15 06:35:34 UTC 2025


#63568: WP_Font_Face: Font names that contain single quotes are not wrapped in
double quotes
-------------------------------------------------+-------------------------
 Reporter:  wildworks                            |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  6.9
Component:  Editor                               |     Version:  6.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-test-info has-         |     Focuses:  ui
  screenshots commit                             |
-------------------------------------------------+-------------------------

Comment (by wildworks):

 > A font with double quotes in the name will fail during upload due to a
 JavaScript error

 I was able to upload a font with double quotes in the site editor, but the
 `@font-face` definition inculudes unescaped double quotes:

 {{{
 @font-face {
   font-family: O"Reilly Sans;
   font-style: normal;
   font-weight: 400;
   font-display: fallback;
   src: url('http://localhost:8888/wp-content/uploads/fonts/O-Reilly-Sans-
 Regular-double-quotes-included.ttf') format('truetype');
 }
 }}}

 As a result, most of the global styles inline CSS will break and no styles
 will be applied to the site.

 I don't have a strong opinion whether we should address this problem in
 [https://github.com/WordPress/wordpress-develop/pull/8982 PR 8982]. As a
 follow-up, we can also improve the normalize_css_font_family_name method
 to escape double quotes.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63568#comment:34>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list