Skip to content

Commit

Permalink
Ensure subscribing to an rSS feed without self reference will select …
Browse files Browse the repository at this point in the history
…simplepie
  • Loading branch information
akirk committed Oct 4, 2022
1 parent af48e11 commit 6a4c7a0
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 0 deletions.
6 changes: 6 additions & 0 deletions feed-parsers/class-feed-parser-simplepie.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public function feed_support_confidence( $url, $mime_type, $title, $content = nu
return 10;
}

switch ( $mime_type ) {
case 'application/xml':
return 5;
}

return 0;
}

Expand Down Expand Up @@ -187,6 +192,7 @@ public function discover_available_feeds( $content, $url ) {
$discovered_feeds[ $feed_url ] = array(
'type' => $mime_type,
'title' => $feed->get_title(),
'parser' => 'simplepie',
'rel' => 'self',
'autoselect' => true,
);
Expand Down
Loading

0 comments on commit 6a4c7a0

Please sign in to comment.