Make WordPress Core

Changeset 55184


Ignore:
Timestamp:
02/01/2023 10:50:11 PM (20 months ago)
Author:
hellofromTonya
Message:

KSES: Allow position-related CSS properties.

Adds support for the following CSS properties considered safe for inline CSS:

  • position
  • top
  • right
  • bottom
  • left
  • z-index

References:

Follow-up to [54117].

Props andrewserong, mukesh27.
Fixes #57504.

Location:
trunk
Files:
2 edited

Legend:

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

    r55053 r55184  
    22782278 *              Added support for `object-fit`, `gap`, `column-gap`, `row-gap`, and `flex-wrap`.
    22792279 *              Extended `margin-*` and `padding-*` support for logical properties.
     2280 * @since 6.2.0 Added support for `position`, `top`, `right`, `bottom`, `left` and `z-index` position CSS properties.
    22802281 *
    22812282 * @param string $css        A string of CSS rules.
     
    24392440            'vertical-align',
    24402441
     2442            'position',
     2443            'top',
     2444            'right',
     2445            'bottom',
     2446            'left',
     2447            'z-index',
     2448
    24412449            // Custom CSS properties.
    24422450            '--*',
  • trunk/tests/phpunit/tests/kses.php

    r55131 r55184  
    12791279                'expected' => '',
    12801280            ),
     1281            // Position properties introduced in 6.2.
     1282            array(
     1283                'css'      => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10;',
     1284                'expected' => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10',
     1285            ),
    12811286        );
    12821287    }
Note: See TracChangeset for help on using the changeset viewer.