Skip to content

Commit d2d2f1c

Browse files
committed
Remove normalization of quoted strings
1 parent 31a0dee commit d2d2f1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/wp-includes/fonts/class-wp-font-face.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ protected function normalize_css_font_family( string $font_family ): string {
404404
__( 'Font font-family should not be wrapped in quotes; they will be added automatically.' ),
405405
'6.9.0'
406406
);
407-
$font_family = substr( $font_family, 1, -1 );
407+
return $font_family;
408408
}
409409

410410
return '"' . strtr(

tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static function data_font_family_normalization() {
7272
*
7373
* @dataProvider data_quoted_font_family_normalization
7474
*/
75-
public function test_quoted_font_family_doing_it_wrong_normalization( string $font_name, string $expected ) {
75+
public function test_quoted_font_family_doing_it_wrong_no_normalization( string $font_name, string $expected ) {
7676
$normalizer = new class() extends WP_Font_Face {
7777
public function test_normalization( string $font_name ): string {
7878
return $this->normalize_css_font_family( $font_name );
@@ -83,9 +83,9 @@ public function test_normalization( string $font_name ): string {
8383

8484
public static function data_quoted_font_family_normalization() {
8585
return array(
86-
"Quoted with '" => array( "'A font name'", '"A font name"' ),
87-
'Quoted with "' => array( '"A font name"', '"A font name"' ),
88-
'Quoted still escaped' => array( '"O\'No (") Double quote in the middle"', '"O\'No (\22 ) Double quote in the middle"' ),
86+
"Quoted with '" => array( "'A font name'", "'A font name'" ),
87+
'Quoted with "' => array( '"A font name"', '"A font name"' ),
88+
'Quoted is not escaped' => array( '"""', '"""' ),
8989
);
9090
}
9191
}

0 commit comments

Comments
 (0)