[Bug] Dynamic OPML re-creates feeds if OPML's xmlUrl is a redirect
Describe the bug
For a Dynamic OPML category, if the OPML file includes a URL that returns a 301 Moved Permanently, then this feed is always muted & re-created.
It looks like FreshRSS_feed_Controller::actualizeFeeds() will update the feed's URL when it detects the redirect. Similar behaviour is not present in FreshRSS_Category::refreshDynamicOpml().
To Reproduce
Here is an example OPML feed: https://gist.github.com/nie7321/f7881db35c7ca52f43736dc312268d97 -- there are a few <outline> tags in here that exhibit the behaviour. Look at https://ahobbitsjourney.wordpress.com/feed as an example case for the repro steps below. When visited, this URL returns a 301 redirect for https://ahobbitsjourney.wordpress.com/feed/ (note the trailing slash).
- Add a Dynamic OPML feed that contains
<outline xmlUrl="...">tags with URLs that will return a 301 redirect. - Let it load the feeds, and then let it load entries.
- Wait until the cronjob refreshes the dynamic OPML.
- Note that many feeds are now duplicated: a muted copy of the "original" feed loaded, and a brand-new copy with all entries unread.
Expected behavior
Match the feed URL update behaviour used when loading entries in the dynamic OPML refresh.
When loading a dynamic OPML, it should try to GET the feed. When it gets a 301 redirect response, and save the redirect location as the feed URL instead of what the OPML file reflects in xmlUrl.
FreshRSS version
1.24.1
Environment information
- PHP version: 8.2.18
- Installation type: Docker
- Web server type: Apache
Additional context
No response
Source: FreshRSS/FreshRSS