diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index b32df1beaa973..9874cddff59e1 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -2333,12 +2333,20 @@ function safecss_filter_attr( $css, $deprecated = '' ) { 'margin-bottom', 'margin-left', 'margin-top', + 'margin-block-start', + 'margin-block-end', + 'margin-inline-start', + 'margin-inline-end', 'padding', 'padding-right', 'padding-bottom', 'padding-left', 'padding-top', + 'padding-block-start', + 'padding-block-end', + 'padding-inline-start', + 'padding-inline-end', 'flex', 'flex-basis', @@ -2346,6 +2354,11 @@ function safecss_filter_attr( $css, $deprecated = '' ) { 'flex-flow', 'flex-grow', 'flex-shrink', + 'flex-wrap', + + 'gap', + 'column-gap', + 'row-gap', 'grid-template-columns', 'grid-auto-columns', diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index e6cac09c3b77f..fc33b44bd3fe3 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -1033,8 +1033,8 @@ public function data_test_safecss_filter_attr() { ), // `flex` and related attributes introduced in 5.3. array( - 'css' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1', - 'expected' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1', + 'css' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1;flex-wrap: nowrap', + 'expected' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1;flex-wrap: nowrap', ), // `grid` and related attributes introduced in 5.3. array( @@ -1120,6 +1120,16 @@ public function data_test_safecss_filter_attr() { 'css' => 'color: rgb( 100, 100, 100, .4 )', 'expected' => '', ), + // Gap introduced in 6.1. + array( + 'css' => 'gap: 10px;column-gap: 5px;row-gap: 20px', + 'expected' => 'gap: 10px;column-gap: 5px;row-gap: 20px', + ), + // Margin and padding logical properties introduced in 6.1. + array( + 'css' => 'margin-block-start: 1px;margin-block-end: 2px;margin-inline-start: 3px;margin-inline-end: 4px;padding-block-start: 1px;padding-block-end: 2px;padding-inline-start: 3px;padding-inline-end: 4px', + 'expected' => 'margin-block-start: 1px;margin-block-end: 2px;margin-inline-start: 3px;margin-inline-end: 4px;padding-block-start: 1px;padding-block-end: 2px;padding-inline-start: 3px;padding-inline-end: 4px', + ), ); }