Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Safe style css: Add position CSS properties to support position contr…
…ols in blocks
  • Loading branch information
andrewserong committed Jan 19, 2023
commit 3b65def3d9b1f3005fb5684bb369ccc6bcc9044b
7 changes: 7 additions & 0 deletions src/wp-includes/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,13 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'overflow',
'vertical-align',

'position',
'top',
'right',
'bottom',
'left',
'z-index',

// Custom CSS properties.
'--*',
)
Expand Down
5 changes: 5 additions & 0 deletions tests/phpunit/tests/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,11 @@ public function data_test_safecss_filter_attr() {
'css' => '--?><.%-not-allowed: red;',
'expected' => '',
),
// Position properties introduced in 6.2.
array(
'css' => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10;',
'expected' => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10',
)
);
}

Expand Down