Skip to content

fix(rss/atom): sanitize enclosure URLs containing &#228

Open
chick-p wants to merge 2 commits intojpmonette:masterfrom
chick-p:fix/sanitize-enclosure-url
Open

fix(rss/atom): sanitize enclosure URLs containing &#228
chick-p wants to merge 2 commits intojpmonette:masterfrom
chick-p:fix/sanitize-enclosure-url

Conversation

@chick-p
Copy link

@chick-p chick-p commented Oct 6, 2025

Fixes #227.

@jpmonette
Copy link
Owner

@chick-p Thanks for the contribution. Could you provide some simple tests for this please?

@Greenheart
Copy link
Contributor

@chick-p I can't edit the git branch directly, but here are some ideas for minimal tests:

The example from the issue could be added as two new test cases - one for RSS and another for Atom:

Invalid:

<enclosure url="https://example.com/hello&world.png" />

Should be sanitized into this:

<enclosure url="https://example.com/hello&amp;world.png" />

These examples could be wrapped in minimal XML and RSS files to represent full test cases.

  • Test URL sanitization for RSS
  • Test URL sanitization for Atom

@chick-p chick-p force-pushed the fix/sanitize-enclosure-url branch from eaaeb29 to 1aafed9 Compare January 12, 2026 11:57
@chick-p
Copy link
Author

chick-p commented Jan 12, 2026

@jpmonette @Greenheart
Thank you for the suggestion!
I've added tests to ensure that enclosure URLs containing & are properly sanitized in both RSS and Atom outputs.
If you have any other feedback or requests, please let me know.

Copy link
Contributor

@Greenheart Greenheart left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests! This looks good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enclosure URLs with & are not properly escaped in XML output

3 participants