Skip to content

Commit ad135d5

Browse files
KSES: Add opacity to the list of safe CSS properties.
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
1 parent 18250a4 commit ad135d5

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/wp-includes/kses.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
25262526
'list-style-type',
25272527
'object-fit',
25282528
'object-position',
2529+
'opacity',
25292530
'overflow',
25302531
'vertical-align',
25312532
'writing-mode',

‎tests/phpunit/tests/kses.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,11 @@ public function data_safecss_filter_attr() {
13531353
'css' => 'background-repeat: no-repeat',
13541354
'expected' => 'background-repeat: no-repeat',
13551355
),
1356+
// `opacity` introduced in 6.7.
1357+
array(
1358+
'css' => 'opacity: 10',
1359+
'expected' => 'opacity: 10',
1360+
),
13561361
);
13571362
}
13581363

0 commit comments

Comments
 (0)