Skip to content

Empty @media queries and custom media types #596

@jonah1und1

Description

@jonah1und1

I've introduced two bugs in my implementation to support @media rules:

  • AntiSamy throws a parsing exception on empty media queries: @media {...}
  • AntiSamy throws a parsing exception on custom media types, even if they are defined in the policy

Expected behaviour
AntiSamy should be able to parse the media rule @media {} as no defined media type implies the media type all.
When defining custom media types in the policy with the _mediatype css-rules property, these should not be filtered by AntiSamy.

Current behaviour
For both these cases AntiSamy throws an CSSParseException.
I've updated my example project with two corresponding tests:
https://github.com/jonah1und1/antisamy-media

Possible Solution
I have created a PR with a possible solution: #597.
Please feel free to comment and/or review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions