Skip to content

Commit

Permalink
KSES: Add writing-mode 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#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
  • Loading branch information
SergeyBiryukov authored and pereirinha committed Sep 21, 2023
1 parent d4e2b24 commit 767266f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,7 @@ function kses_init() {
* and `z-index` CSS properties.
* @since 6.3.0 Extended support for `filter` to accept a URL and added support for repeat().
* Added support for `box-shadow`.
* @since 6.4.0 Added support for `writing-mode`.
*
* @param string $css A string of CSS rules.
* @param string $deprecated Not used.
Expand Down Expand Up @@ -2461,6 +2462,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'object-position',
'overflow',
'vertical-align',
'writing-mode',

'position',
'top',
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 @@ -1341,6 +1341,11 @@ public function data_safecss_filter_attr() {
'css' => 'grid-template-columns: repeat(4, unsupported(0, 1fr)',
'expected' => '',
),
// `writing-mode` introduced in 6.4.
array(
'css' => 'writing-mode: vertical-rl',
'expected' => 'writing-mode: vertical-rl',
),
);
}

Expand Down

0 comments on commit 767266f

Please sign in to comment.