Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe style css: Add position CSS properties to support position controls in blocks #3865

Closed
Show file tree
Hide file tree
Changes from 2 commits
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
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',
andrewserong marked this conversation as resolved.
Show resolved Hide resolved

// 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