Skip to content

AO3-7637 Prevent invalid links from breaking eBook downloads - #6082

Open
marquesaline wants to merge 3 commits into
otwcode:masterfrom
marquesaline:AO3-7637-invalid-links-ebook-downloads
Open

marquesaline wants to merge 3 commits into
otwcode:masterfrom
marquesaline:AO3-7637-invalid-links-ebook-downloads

Conversation

@marquesaline

Copy link
Copy Markdown

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-XXXX (Please fill in issue number and remove this comment.)

Purpose

This fixes a bug where a malformed link could prevent non-HTML eBook downloads from being generated.

The invalid href is removed, but the link text is kept. Valid links, including links with non-ASCII characters, are left unchanged.

The sanitizer version is increased so previously saved works are sanitized again.

Testing Instructions

  1. Create a work with this link in the body, notes, or endnotes:

    <a href="https://[https://test.archiveofourown.org/users/testy]" rel="nofollow">testy</a>

  2. Save the work.

  3. Download it in any format other than HTML.

  4. Check that the download works and the text testy is still there.

  5. Try saving a link with https://exa mple.com and check that it does not cause an error.

  6. Check that a valid link with non-ASCII characters is not removed.

Credit

Aline Marques (she/her)

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant