Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kses filter for un-prettified filters #49004

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

ajlende
Copy link
Contributor

@ajlende ajlende commented Mar 10, 2023

What?

Updates the regex to allow for zero spaces between filter: and url(.

Why?

Fixes #48974

How?

The style engine has an option where it doesn't include spaces if SCRIPT_DEBUG is true.

It was causing custom duotone filters (including presets applied prior to GB 15.2.4 which were treated as custom filters) to be stripped by kses because the lack of spaces wasn't accounted for in the regex.

Testing Instructions

  1. Ensure define( 'SCRIPT_DEBUG', false ); is set in wp-config.php
  2. Add a block with a custom duotone filter to a post/page. Do not use the presets.
  3. View the post/page in the frontend.
  4. Duotone filter should be applied.

Testing Instructions for Keyboard

Screenshots or screencast

@ajlende ajlende added the [Type] Bug An existing feature does not function as intended label Mar 10, 2023
@ajlende ajlende self-assigned this Mar 10, 2023
@github-actions
Copy link

Flaky tests detected in df02eba.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4389377819
📝 Reported issues:

Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scruffian
Copy link
Contributor

I think we should add tests for this but I'm going to do that in a different PR.

@scruffian scruffian merged commit 4feb24f into trunk Mar 13, 2023
@scruffian scruffian deleted the fix/broken-duotone-frontend-48974 branch March 13, 2023 12:13
@github-actions github-actions bot added this to the Gutenberg 15.4 milestone Mar 13, 2023
@scruffian
Copy link
Contributor

Here's a unit test for this: #49033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duotone filter not applied on existing cover block on front end
2 participants