PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | modules/google-fonts/current/class-jetpack-google-font-face.php +5 -6 16.2 → 16.3-a.7 View file →
@@ -73,9 +73,9 @@
73 73 $fonts_in_use = array_map(
74 74 function ( $font_slug ) use ( $font_slug_aliases ) {
75 75 return $font_slug_aliases[ $font_slug ] ?? $font_slug;
76 76 },
77 - $this->fonts_in_use
77 + $fonts_in_use
78 78 );
79 79
80 80 foreach ( $fonts as $font_faces ) {
81 81 $font_family = $font_faces[0]['font-family'] ?? '';
@@ -222,11 +222,10 @@
222 222 if ( ! is_string( $font_family ) ) {
223 223 return null;
224 224 }
225 225
226 - // Full string: var(--wp--preset--font-family--slug).
227 - // We do not care about the origin of the font, only its slug.
228 - preg_match( '/font-family--(?P<slug>.+)\)$/', $font_family, $matches );
226 + // A preset reference can include a var() fallback and a trailing font stack.
227 + preg_match( '/^\s*var\(\s*--wp--preset--font-family--(?P<slug>[^\s,()]+)\s*[,)]/', $font_family, $matches );
229 228
230 229 if ( isset( $matches['slug'] ) ) {
231 230 return $matches['slug'];
232 231 }
@@ -232,15 +231,15 @@
232 231 }
233 232
234 233 // Full string: var:preset|font-family|slug
235 234 // We do not care about the origin of the font, only its slug.
236 - preg_match( '/font-family\|(?P<slug>.+)$/', $font_family, $matches );
235 + preg_match( '/^\s*var:preset\|font-family\|(?P<slug>[^\s,]+)/', $font_family, $matches );
237 236
238 237 if ( isset( $matches['slug'] ) ) {
239 238 return $matches['slug'];
240 239 }
241 240
242 - return $font_family;
241 + return self::get_font_family_name( $setting['typography'] );
243 242 }
244 243
245 244 /**
246 245 * Check if the current screen is the block editor.