mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 22:58:40 +02:00
KSES: Allow min()
, max()
, minmax()
, and clamp()
values to be used in inline CSS.
Follow-up to [50923]. Props johnregan3, uxl, isabel_brison, andrewserong, ramonopoly, noisysocks, joyously. See #55966. Built from https://develop.svn.wordpress.org/trunk@54092 git-svn-id: http://core.svn.wordpress.org/trunk@53651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
96dd426d21
commit
a15d6fd15b
@ -2228,6 +2228,7 @@ function kses_init() {
|
|||||||
* @since 5.3.1 Added support for gradient backgrounds.
|
* @since 5.3.1 Added support for gradient backgrounds.
|
||||||
* @since 5.7.1 Added support for `object-position`.
|
* @since 5.7.1 Added support for `object-position`.
|
||||||
* @since 5.8.0 Added support for `calc()` and `var()` values.
|
* @since 5.8.0 Added support for `calc()` and `var()` values.
|
||||||
|
* @since 6.1.0 Added support for `min()`, `max()`, `minmax()`, and `clamp()` values.
|
||||||
*
|
*
|
||||||
* @param string $css A string of CSS rules.
|
* @param string $css A string of CSS rules.
|
||||||
* @param string $deprecated Not used.
|
* @param string $deprecated Not used.
|
||||||
@ -2467,10 +2468,11 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $found ) {
|
if ( $found ) {
|
||||||
// Allow CSS calc().
|
// Allow some CSS functions.
|
||||||
$css_test_string = preg_replace( '/calc\(((?:\([^()]*\)?|[^()])*)\)/', '', $css_test_string );
|
$css_test_string = preg_replace( '/\b(?:calc|min|max|minmax|clamp)\(((?:\([^()]*\)?|[^()])*)\)/', '', $css_test_string );
|
||||||
|
|
||||||
// Allow CSS var().
|
// Allow CSS var().
|
||||||
$css_test_string = preg_replace( '/\(?var\(--[a-zA-Z0-9_-]*\)/', '', $css_test_string );
|
$css_test_string = preg_replace( '/\(?var\(--[\w\-\()[\]\,\s]*\)/', '', $css_test_string );
|
||||||
|
|
||||||
// Check for any CSS containing \ ( & } = or comments,
|
// Check for any CSS containing \ ( & } = or comments,
|
||||||
// except for url(), calc(), or var() usage checked above.
|
// except for url(), calc(), or var() usage checked above.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-54091';
|
$wp_version = '6.1-alpha-54092';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user