Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feedLink() is broken, returns invalid data if not found #44

Open
Crell opened this issue Nov 18, 2021 · 3 comments · May be fixed by #45
Open

feedLink() is broken, returns invalid data if not found #44

Crell opened this issue Nov 18, 2021 · 3 comments · May be fixed by #45

Comments

@Crell
Copy link
Contributor

Crell commented Nov 18, 2021

Bug Report

Q A
Version(s) 2.15

Summary

The getFeedLink() method is broken and returns invalid data.

Current behavior

getFeedLink() on an RSS feed falls back to the Atom\Feed extension, and calls it's getFeedLink() method.

Atom\Feed::getLink() first looks for a <link rel="self" /> element to get a link. If it finds nothing, it gets an empty string. So far so good.

However, it then calls absolutiseUrl() on that value unconditionally, which when passed an empty string dutifully slaps the base domain of the feed onto the start of an empty string, giving you the domain of the site... Which is almost certainly not the self link of the feed, and may not even be related to the feed in the first place. But that's what then gets returned.

How to reproduce

Feed (no pun intended) any RSS feed with no self link into it and call getFeedLink().

Expected behavior

According to the method signatures, it should return null if there is no self link.

@Crell Crell added the Bug Something isn't working label Nov 18, 2021
@froschdesign
Copy link
Member

@Crell
Thanks for reporting!

Unfortunately, I can not reproduce the problem. Can your provide an uni test which illustrates the problem?
Thanks in advance! 👍

@rajjanorkar
Copy link
Contributor

rajjanorkar commented Aug 7, 2022

Feed entry link is null for below feed source [fox news]

getPermalink() is returning null.

https://feeds.feedburner.com/foxnews/latest

@Ocramius
Copy link
Member

Ocramius commented Aug 7, 2022

It should probably return null for all of Fox News 🤣

Jokes apart, we'd need this as an automated test case, in order for it to be fixed.

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

Successfully merging a pull request may close this issue.

4 participants