mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-09-22 00:40:20 +00:00
KSES: Revert [54092] for now to address unit test failures.
See #55966. git-svn-id: https://develop.svn.wordpress.org/trunk@54093 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2228,7 +2228,6 @@ function kses_init() {
|
||||
* @since 5.3.1 Added support for gradient backgrounds.
|
||||
* @since 5.7.1 Added support for `object-position`.
|
||||
* @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 $deprecated Not used.
|
||||
@@ -2468,11 +2467,10 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
|
||||
}
|
||||
|
||||
if ( $found ) {
|
||||
// Allow some CSS functions.
|
||||
$css_test_string = preg_replace( '/\b(?:calc|min|max|minmax|clamp)\(((?:\([^()]*\)?|[^()])*)\)/', '', $css_test_string );
|
||||
|
||||
// Allow CSS calc().
|
||||
$css_test_string = preg_replace( '/calc\(((?:\([^()]*\)?|[^()])*)\)/', '', $css_test_string );
|
||||
// Allow CSS var().
|
||||
$css_test_string = preg_replace( '/\(?var\(--[\w\-\()[\]\,\s]*\)/', '', $css_test_string );
|
||||
$css_test_string = preg_replace( '/\(?var\(--[a-zA-Z0-9_-]*\)/', '', $css_test_string );
|
||||
|
||||
// Check for any CSS containing \ ( & } = or comments,
|
||||
// except for url(), calc(), or var() usage checked above.
|
||||
|
||||
Reference in New Issue
Block a user