Make WordPress Core


Ignore:
Timestamp:
09/22/2019 10:16:19 PM (4 years ago)
Author:
peterwilsoncc
Message:

KSES: Add support for modern layout techniques in style attribute.

Adds support for flex, grid and column layout techniques to the list of CSS attributes considered safe for inline CSS. The \ character and CSS functions, eg minmax() are not yet supported.

Extends support of border properties to include border-radius and individual background properties to include all those implicitly supported by the shorthand attribute.

Props mrahmadawais, marybaum, birgire, peterwilsoncc, azaozz.
Fixes #37248.
See #47367.

File:
1 edited

Legend:

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

    r45997 r46235  
    20722072     * @since 5.1.0 Added support for `text-transform`.
    20732073     * @since 5.2.0 Added support for `background-position` and `grid-template-columns`
    2074      * @since 5.3.0 Added support for `flex`, `flex-grow`, `flex-shrink`, and `flex-basis`.
     2074     * @since 5.3.0 Added support for `grid`, `flex` and `column` layout properties.
     2075     *              Extend `background-*` support of individual properties.
    20752076     *
    20762077     * @param string[] $attr Array of allowed CSS attributes.
     
    20832084            'background-image',
    20842085            'background-position',
     2086            'background-size',
     2087            'background-attachment',
     2088            'background-blend-mode',
    20852089
    20862090            'border',
     2091            'border-radius',
    20872092            'border-width',
    20882093            'border-color',
     
    21092114            'caption-side',
    21102115
     2116            'columns',
     2117            'column-count',
     2118            'column-fill',
     2119            'column-gap',
     2120            'column-rule',
     2121            'column-span',
     2122            'column-width',
     2123
    21112124            'color',
    21122125            'font',
     
    21442157
    21452158            'flex',
     2159            'flex-basis',
     2160            'flex-direction',
     2161            'flex-flow',
    21462162            'flex-grow',
    21472163            'flex-shrink',
    2148             'flex-basis',
     2164
     2165            'grid-template-columns',
     2166            'grid-auto-columns',
     2167            'grid-column-start',
     2168            'grid-column-end',
     2169            'grid-column-gap',
     2170            'grid-template-rows',
     2171            'grid-auto-rows',
     2172            'grid-row-start',
     2173            'grid-row-end',
     2174            'grid-row-gap',
     2175            'grid-gap',
     2176
     2177            'justify-content',
     2178            'justify-items',
     2179            'justify-self',
     2180            'align-content',
     2181            'align-items',
     2182            'align-self',
    21492183
    21502184            'clear',
     
    21552189            'vertical-align',
    21562190            'list-style-type',
    2157             'grid-template-columns',
    21582191        )
    21592192    );
Note: See TracChangeset for help on using the changeset viewer.