Make WordPress Core

Changeset 45363


Ignore:
Timestamp:
05/18/2019 04:33:27 AM (7 years ago)
Author:
peterwilsoncc
Message:

KSES: Add flex and related long form properties to safe CSS.

Allow flex, flex-grow, flex-shrink and flex-basis to be used in inline CSS. As of WordPress 5.3 the block editor is expected to use flex-basis inline to set the width in the column block.

Props aduth.
Fixes #47281.
See #37248.

Location:
trunk
Files:
2 edited

Legend:

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

    r45242 r45363  
    20642064         * @since 5.1.0 Added support for `text-transform`.
    20652065         * @since 5.2.0 Added support for `background-position` and `grid-template-columns`
     2066         * @since 5.3.0 Added support for `flex`, `flex-grow`, `flex-shrink`, and `flex-basis`.
    20662067         *
    20672068         * @param string[] $attr Array of allowed CSS attributes.
     
    21342135                        'padding-top',
    21352136
     2137                        'flex',
     2138                        'flex-grow',
     2139                        'flex-shrink',
     2140                        'flex-basis',
     2141
    21362142                        'clear',
    21372143                        'cursor',
  • trunk/tests/phpunit/tests/kses.php

    r44156 r45363  
    831831                                'expected' => 'background: green url("foo.jpg") no-repeat fixed center',
    832832                        ),
     833                        // `flex` and related attributes introduced in 5.3.
     834                        array(
     835                                'css'      => 'flex: 0 1 auto;flex-basis: 75%;flex-shrink: 0;flex-grow: 1',
     836                                'expected' => 'flex: 0 1 auto;flex-basis: 75%;flex-shrink: 0;flex-grow: 1',
     837                        ),
    833838                );
    834839        }
Note: See TracChangeset for help on using the changeset viewer.