KSES: Allow filter property to accept a URL in safecss_filter_attr().

CSS filters can accept `url()` as a reference to an SVG filter element:
{{{
filter: url( file.svg#filter-element-id );
}}}
This commit allows for that syntax to be used in inline CSS.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/48281 #48281 Duotone: Use the style engine to generate CSS for Duotone]

References:
* [https://developer.mozilla.org/en-US/docs/Web/CSS/filter MDN Web Docs: filter()]
* [https://developer.mozilla.org/en-US/docs/Web/CSS/url MDN Web Docs: url()]

Follow-up to [44136], [52049].

Props scruffian, jeryj, ironprogrammer, azaozz, hellofromTonya, SergeyBiryukov.
Fixes #57780.
Built from https://develop.svn.wordpress.org/trunk@55564


git-svn-id: http://core.svn.wordpress.org/trunk@55076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-03-20 08:25:22 +00:00
parent 4630e311e7
commit 6740fd5821
2 changed files with 3 additions and 1 deletions

View File

@ -2279,6 +2279,7 @@ function kses_init() {
* Extended `margin-*` and `padding-*` support for logical properties. * Extended `margin-*` and `padding-*` support for logical properties.
* @since 6.2.0 Added support for `aspect-ratio`, `position`, `top`, `right`, `bottom`, `left`, * @since 6.2.0 Added support for `aspect-ratio`, `position`, `top`, `right`, `bottom`, `left`,
* and `z-index` CSS properties. * and `z-index` CSS properties.
* @since 6.3.0 Extended support for `filter` to accept a URL.
* *
* @param string $css A string of CSS rules. * @param string $css A string of CSS rules.
* @param string $deprecated Not used. * @param string $deprecated Not used.
@ -2466,6 +2467,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'background-image', 'background-image',
'cursor', 'cursor',
'filter',
'list-style', 'list-style',
'list-style-image', 'list-style-image',

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-alpha-55563'; $wp_version = '6.3-alpha-55564';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.