Make WordPress Core


Ignore:
Timestamp:
09/08/2022 01:24:10 PM (2 years ago)
Author:
SergeyBiryukov
Message:

KSES: Allow min(), max(), minmax(), and clamp() values to be used in inline CSS.

Additionally, this commit updates safecss_filter_attr() to add support for nested var() functions, so that a fallback value can be another CSS variable.

Follow-up to [50923].

Props johnregan3, noisysocks, cbravobernal, uxl, isabel_brison, andrewserong, ramonopoly, joyously, bernhard-reiter, peterwilsoncc.
Fixes #55966.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r53129 r54100  
    16031603                        'core/cover'  => array(
    16041604                            'filter' => array(
    1605                                 'duotone' => 'var(--wp--preset--duotone--blue-red, var(--fallback-unsafe))',
     1605                                'duotone' => 'var(--invalid',
    16061606                            ),
    16071607                        ),
     
    16771677                        'radius' => array(
    16781678                            'topLeft'     => '6px',
    1679                             'topRight'    => 'var(--top-right, var(--unsafe-fallback))',
     1679                            'topRight'    => 'var(--invalid',
    16801680                            'bottomRight' => '6px',
    16811681                            'bottomLeft'  => '6px',
     
    16861686                            'top'    => '1px',
    16871687                            'right'  => '1px',
    1688                             'bottom' => 'var(--bottom, var(--unsafe-fallback))',
     1688                            'bottom' => 'var(--invalid',
    16891689                            'left'   => '1px',
    16901690                        ),
     
    16961696                                    'top'    => '2px',
    16971697                                    'right'  => '2px',
    1698                                     'bottom' => 'var(--bottom, var(--unsafe-fallback))',
     1698                                    'bottom' => 'var(--invalid',
    16991699                                    'left'   => '2px',
    17001700                                ),
     
    17071707                                'radius' => array(
    17081708                                    'topLeft'     => '5px',
    1709                                     'topRight'    => 'var(--top-right, var(--unsafe-fallback))',
     1709                                    'topRight'    => 'var(--invalid',
    17101710                                    'bottomRight' => '5px',
    17111711                                    'bottomLeft'  => '5px',
     
    17161716                                    'top'    => '3px',
    17171717                                    'right'  => '3px',
    1718                                     'bottom' => 'var(bottom, var(--unsafe-fallback))',
     1718                                    'bottom' => 'var(--invalid',
    17191719                                    'left'   => '3px',
    17201720                                ),
     
    17261726                                            'top'    => '4px',
    17271727                                            'right'  => '4px',
    1728                                             'bottom' => 'var(--bottom, var(--unsafe-fallback))',
     1728                                            'bottom' => 'var(--invalid',
    17291729                                            'left'   => '4px',
    17301730                                        ),
     
    19451945                                    'name'  => 'Blue',
    19461946                                    'slug'  => 'blue',
    1947                                     'color' => 'var(--color, var(--unsafe-fallback))',
     1947                                    'color' => 'var(--invalid',
    19481948                                ),
    19491949                                array(
     
    19761976                                    'name'       => 'Helvetica Arial',
    19771977                                    'slug'       => 'helvetica-arial',
    1978                                     'fontFamily' => 'var(--fontFamily, var(--unsafe-fallback))',
     1978                                    'fontFamily' => 'var(--invalid',
    19791979                                ),
    19801980                            ),
     
    19991999                                            'name'  => 'Blue',
    20002000                                            'slug'  => 'blue',
    2001                                             'color' => 'var(--color, var(--unsafe--fallback))',
     2001                                            'color' => 'var(--invalid',
    20022002                                        ),
    20032003                                        array(
Note: See TracChangeset for help on using the changeset viewer.