New function get_icon_url() for feed favicon#73
Merged
Conversation
Only atom:icon and a square rss2:image can be used to represent a favicon. The existing get_image_url() is more for logos / banners, not favicon. Example of real-world feeds: * https://feedpress.me/frandroid * https://www.lesnumeriques.com/rss.xml Downstream: * FreshRSS/FreshRSS#5518 * FreshRSS/FreshRSS#8633
4 tasks
Alkarex
added a commit
to bowencool/FreshRSS
that referenced
this pull request
Mar 29, 2026
Alkarex
added a commit
to FreshRSS/FreshRSS
that referenced
this pull request
Mar 31, 2026
…go, JSON Feed icon) (#8633) * prefer feed.icon Closes #5518 Changes proposed in this pull request: - When a feed provides an icon URL (<image><url> in RSS 2.0/1.0, <atom:icon>/<atom:logo> in Atom, icon/favicon fields in JSON Feed), that URL is stored as a feedIconUrl attribute on the feed and used as the primary source for favicon downloads, instead of scraping the feed's website for <link rel="icon"> tags. - If the feed-provided icon URL fails to return a valid image, the existing fallback chain (website HTML favicon search → /favicon.ico) is preserved. Custom favicons uploaded by users always take priority and are never overridden. How to test the feature manually: 1. Add an RSS feed that includes a <image><url> element (e.g. an RSSHub feed: `https://rsshub.app/youtube/channel/UC2cRwTuSWxxEtrRnT4lrlQA`). After actualization, confirm the feed's favicon matches the avatar image from the feed, not the Bilibili site favicon. 2. Add an Atom feed containing <atom:icon> or <atom:logo> Confirm the feed icon is used. 3. Add a JSON Feed (spec: icon field). Confirm icon is preferred over favicon when both are present. 4. Temporarily point a feed's <image><url> to a broken URL. Confirm FreshRSS falls back to the website favicon silently. 5. Upload a custom favicon for a feed, then actualize it. Confirm the custom favicon is not replaced. <img width="470" height="317" alt="image" src="https://github.com/user-attachments/assets/17445154-d94c-44d6-b7e7-019bf24c5767" /> * fix(favicon): use htmlspecialchars_decode for feed image URL * Decode quotes as well * New function in our SimplePie fork FreshRSS/simplepie#73 --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Alkarex
added a commit
to Alkarex/FreshRSS
that referenced
this pull request
Apr 1, 2026
Alkarex
added a commit
to FreshRSS/FreshRSS
that referenced
this pull request
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only atom:icon and a square rss2:image can be used to represent a favicon.
The existing get_image_url() is more for logos / banners, not favicon.
Examples of real-world feeds:
Downstream:
Upstream: