Skip to content

Commit

Permalink
KSES: Add opacity to the list of safe CSS properties.
Browse files Browse the repository at this point in the history
Original PR from Gutenberg repository:
* [WordPress/gutenberg#59891 #59891 Update overlay step function in cover block]

Reference: [https://developer.mozilla.org/en-US/docs/Web/CSS/opacity MDN Web Docs: opacity].

Props sunil25393, wildworks, poena, Mamaduka, presstoke.
Fixes #61536.

git-svn-id: https://develop.svn.wordpress.org/trunk@58709 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 12, 2024
1 parent 18250a4 commit ad135d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/wp-includes/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'list-style-type',
'object-fit',
'object-position',
'opacity',
'overflow',
'vertical-align',
'writing-mode',
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 @@ -1353,6 +1353,11 @@ public function data_safecss_filter_attr() {
'css' => 'background-repeat: no-repeat',
'expected' => 'background-repeat: no-repeat',
),
// `opacity` introduced in 6.7.
array(
'css' => 'opacity: 10',
'expected' => 'opacity: 10',
),
);
}

Expand Down

0 comments on commit ad135d5

Please sign in to comment.