Skip to content

Commit 0e28444

Browse files
KSES: Add background-repeat to the list of safe CSS properties.
Follow-up to [45242], [46235]. Props andrewserong, ramonopoly, mukesh27. Fixes #60132. git-svn-id: https://develop.svn.wordpress.org/trunk@57228 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e9f335d commit 0e28444

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/wp-includes/kses.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,7 @@ function kses_init() {
23032303
* @since 6.3.0 Extended support for `filter` to accept a URL and added support for repeat().
23042304
* Added support for `box-shadow`.
23052305
* @since 6.4.0 Added support for `writing-mode`.
2306+
* @since 6.5.0 Added support for `background-repeat`.
23062307
*
23072308
* @param string $css A string of CSS rules.
23082309
* @param string $deprecated Not used.
@@ -2334,6 +2335,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
23342335
'background-color',
23352336
'background-image',
23362337
'background-position',
2338+
'background-repeat',
23372339
'background-size',
23382340
'background-attachment',
23392341
'background-blend-mode',

‎tests/phpunit/tests/kses.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,8 @@ public function test_wp_kses_attr_no_attributes_allowed_with_false() {
938938
* @ticket 55966
939939
* @ticket 56122
940940
* @ticket 58551
941+
* @ticket 60132
942+
*
941943
* @dataProvider data_safecss_filter_attr
942944
*
943945
* @param string $css A string of CSS rules.
@@ -1346,6 +1348,11 @@ public function data_safecss_filter_attr() {
13461348
'css' => 'writing-mode: vertical-rl',
13471349
'expected' => 'writing-mode: vertical-rl',
13481350
),
1351+
// `background-repeat` introduced in 6.5.
1352+
array(
1353+
'css' => 'background-repeat: no-repeat',
1354+
'expected' => 'background-repeat: no-repeat',
1355+
),
13491356
);
13501357
}
13511358

0 commit comments

Comments
 (0)