-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
Feed parsing: use author email when there's no author name #1801
Conversation
A random feed where authors were not parsed properly: https://devnet.kentico.com/rss/articles I could not find which test could be extended to cover this, so I did not write any new test. |
app/Models/Feed.php
Outdated
@@ -355,7 +355,7 @@ public function loadEntries($feed) { | |||
$this->id(), | |||
$item->get_id(false, false), | |||
$title === null ? '' : $title, | |||
$author === null ? '' : html_only_entity_decode(strip_tags($author->name)), | |||
$author === null ? '' : html_only_entity_decode(strip_tags($author->name === null ? $author->email : $author->name)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest == ''
instead of === null
to catch other nullish values such as empty strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I pushed-force with a fix for that
Thanks! 👍 |
This is especially useful because when author is given as `<author>Author Name</author>` ( as in this example https://cyber.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt ), SimplePie will expose *Author Name* as `email`.
670b7a2
to
4d6449b
Compare
…1801) This is especially useful because when author is given as `<author>Author Name</author>` ( as in this example https://cyber.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt ), SimplePie will expose *Author Name* as `email`.
…1801) This is especially useful because when author is given as `<author>Author Name</author>` ( as in this example https://cyber.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt ), SimplePie will expose *Author Name* as `email`.
This is especially useful because when author is given as
<author>Author Name</author>
( as in this examplehttps://cyber.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt ),
SimplePie will expose Author Name as
email
.