Skip to content

Commit 94d0172

Browse files
committed
Media: Add object-fit to the allowed list of CSS properties.
This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`. Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai, davidbaumwald. Merges [54675] to the 5.9 branch. Fixes #56855. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@54764 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 007118d commit 94d0172

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/wp-includes/kses.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,6 +2415,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
24152415
'direction',
24162416
'float',
24172417
'list-style-type',
2418+
'object-fit',
24182419
'object-position',
24192420
'overflow',
24202421
'vertical-align',

tests/phpunit/tests/kses.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,11 @@ public function data_test_safecss_filter_attr() {
10931093
'css' => 'background: conic-gradient(at 0% 30%, red 10%, yellow 30%, #1e90ff 50%)',
10941094
'expected' => 'background: conic-gradient(at 0% 30%, red 10%, yellow 30%, #1e90ff 50%)',
10951095
),
1096+
// `object-fit` introduced in 6.1.
1097+
array(
1098+
'css' => 'object-fit: cover',
1099+
'expected' => 'object-fit: cover',
1100+
),
10961101
// Expressions are not allowed.
10971102
array(
10981103
'css' => 'height: expression( body.scrollTop + 50 + "px" )',

0 commit comments

Comments
 (0)