Skip to content

Interactive search: link release titles to their tracker page - #99

Open
ndandan wants to merge 2 commits into
Shoshuo:mainfrom
ndandan:pr/interactive-search-tracker-links
Open

Interactive search: link release titles to their tracker page#99
ndandan wants to merge 2 commits into
Shoshuo:mainfrom
ndandan:pr/interactive-search-tracker-links

Conversation

@ndandan

@ndandan ndandan commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #35.

Radarr/Sonarr already return an infoUrl per release; the release mappers just dropped it. This PR:

  • maps infoUrl in all three interactive-search endpoints (film / episode / season) through a small safeInfoUrl() allowlist — only http(s):// URLs are emitted, anything else (including javascript:/data: from a hostile indexer) maps to null;
  • wraps the release title in <a href target="_blank" rel="noopener"> in both release tables when an infoUrl is present, plain text otherwise. The rejection marker stays outside the link.

Tests: MediaReleasesSearchTest gains mapping tests for all three endpoints (URL kept, missing key → null, javascript: → null, uppercase HTTPS:// kept, non-string → null). 7 tests / 24 assertions green, lint:twig clean.

🤖 Generated with Claude Code

ndandan and others added 2 commits August 22, 2026 20:03
…page (infoUrl) — upstream Shoshuo#35

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
infoUrl is passed through verbatim from the Radarr/Sonarr release
payload, which is in turn sourced from whatever indexer answered the
interactive search. A hostile/compromised indexer could return a
javascript:/data: URL, which would previously reach the frontend
unfiltered and land in the anchor's href. Sanitize once, at the
controller mapping (single testable choke point), rather than relying
on the fork's CSP — this commit becomes an upstream PR where that CSP
does not exist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

[Feature] Include tracker URLs in interactive search results

1 participant