Skip to content

Commit cf2f441

Browse files
KSES: Add writing-mode to the list of safe CSS properties.
Original PR from Gutenberg repository: * [WordPress/gutenberg#54581 #54581 Gutenberg Plugin: Add hook to allow `writing-mode` as a safe CSS property] Reference: [https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode MDN Web Docs: writing-mode]. Follow-up to [56605]. Props wildworks, mukesh27, poena, andrewserong. Fixes #59387. git-svn-id: https://develop.svn.wordpress.org/trunk@56617 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8ce85f9 commit cf2f441

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/wp-includes/kses.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,7 @@ function kses_init() {
23012301
* and `z-index` CSS properties.
23022302
* @since 6.3.0 Extended support for `filter` to accept a URL and added support for repeat().
23032303
* Added support for `box-shadow`.
2304+
* @since 6.4.0 Added support for `writing-mode`.
23042305
*
23052306
* @param string $css A string of CSS rules.
23062307
* @param string $deprecated Not used.
@@ -2461,6 +2462,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
24612462
'object-position',
24622463
'overflow',
24632464
'vertical-align',
2465+
'writing-mode',
24642466

24652467
'position',
24662468
'top',

‎tests/phpunit/tests/kses.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,11 @@ public function data_safecss_filter_attr() {
13411341
'css' => 'grid-template-columns: repeat(4, unsupported(0, 1fr)',
13421342
'expected' => '',
13431343
),
1344+
// `writing-mode` introduced in 6.4.
1345+
array(
1346+
'css' => 'writing-mode: vertical-rl',
1347+
'expected' => 'writing-mode: vertical-rl',
1348+
),
13441349
);
13451350
}
13461351

0 commit comments

Comments
 (0)