Make WordPress Core

Changeset 55564


Ignore:
Timestamp:
03/20/2023 08:23:47 AM (16 months ago)
Author:
SergeyBiryukov
Message:

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:

References:

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

Props scruffian, jeryj, ironprogrammer, azaozz, hellofromTonya, SergeyBiryukov.
Fixes #57780.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r55309 r55564  
    22802280 * @since 6.2.0 Added support for `aspect-ratio`, `position`, `top`, `right`, `bottom`, `left`,
    22812281 *              and `z-index` CSS properties.
     2282 * @since 6.3.0 Extended support for `filter` to accept a URL.
    22822283 *
    22832284 * @param string $css        A string of CSS rules.
     
    24672468
    24682469        'cursor',
     2470        'filter',
    24692471
    24702472        'list-style',
  • trunk/tests/phpunit/tests/kses.php

    r55563 r55564  
    13171317                'expected' => '',
    13181318            ),
     1319            // URL support for `filter` introduced in 6.3.
     1320            array(
     1321                'css'      => 'filter: url( my-file.svg#svg-blur );',
     1322                'expected' => 'filter: url( my-file.svg#svg-blur )',
     1323            ),
    13191324        );
    13201325    }
Note: See TracChangeset for help on using the changeset viewer.