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

[FeedExpander] Deal with empty item #535

Merged
merged 1 commit into from
Jul 3, 2017

Conversation

Frenzie
Copy link
Contributor

@Frenzie Frenzie commented Jun 11, 2017

See the comment #402 (comment)

Copy link
Member

@logmanoriginal logmanoriginal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition, I like it quite a lot 👍

This PR has two topics mixed:

  • The changes to the core API (FeedExpander)
  • Adding a new bridge (FilterBridge)

Please split these changes into separate PRs. Since FilterBridge depends on the changes to FeedExpander, we need to merge the latter one first, so I based my review on the changes to FeedExpander.

@@ -48,7 +48,9 @@ protected function collect_RSS_1_0_data($rssContent, $maxItems){
$this->load_RSS_2_0_feed_data($rssContent->channel[0]);
foreach($rssContent->item as $item){
debugMessage('parsing item ' . var_export($item, true));
$this->items[] = $this->parseItem($item);
if (null !== $this->parseItem($item)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->parseItem($item) will return an empty array for native types (see parseRSS_1_0_Item for example), so instead of checking for null check if the array is empty: if(empty($this->parseItem($item)){

@@ -48,7 +48,9 @@ protected function collect_RSS_1_0_data($rssContent, $maxItems){
$this->load_RSS_2_0_feed_data($rssContent->channel[0]);
foreach($rssContent->item as $item){
debugMessage('parsing item ' . var_export($item, true));
$this->items[] = $this->parseItem($item);
if (null !== $this->parseItem($item)) {
$this->items[] = $this->parseItem($item);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is calling the same function as in the if-statement. Since parseItem could potentially load additional data during execution its result should be put into a variable instead of calling it twice.

@Frenzie Frenzie changed the title [FilterBridge] Initial implementation of basic title permit and block [FeedExpander] Deal with empty item Jun 24, 2017
Frenzie added a commit to Frenzie/rss-bridge that referenced this pull request Jun 24, 2017
@logmanoriginal logmanoriginal merged commit 341010b into RSS-Bridge:master Jul 3, 2017
@logmanoriginal
Copy link
Member

Thanks for updating 👍

@Frenzie Frenzie deleted the filterbridge branch November 8, 2019 11:28
infominer33 pushed a commit to web-work-tools/rss-bridge that referenced this pull request Apr 17, 2020
infominer33 pushed a commit to web-work-tools/rss-bridge that referenced this pull request Apr 17, 2020
[FeedExpander] Deal with empty item
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.

None yet

2 participants