mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-24 03:58:33 -04:00
Set feed error state when XPath does not match (#4275)
Gives the ability to filter HTML+XPath feeds that are not working
This commit is contained in:
1 parent
6f018cc674
commit
4363e13c34
2 files changed
+4
No files matched your search
@@ -375,6 +375,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
|
||||
$simplePie = $simplePiePush; //Used by WebSub
|
||||
} elseif ($feed->kind() === FreshRSS_Feed::KIND_HTML_XPATH) {
|
||||
$simplePie = $feed->loadHtmlXpath(false, $isNewFeed);
|
||||
if ($simplePie == null) {
|
||||
throw new FreshRSS_Feed_Exception('HTML+XPath Web scraping failed for [' . $feed->url(false) . ']');
|
||||
}
|
||||
} else {
|
||||
$simplePie = $feed->load(false, $isNewFeed);
|
||||
}
|
||||
|
||||
@@ -424,6 +424,7 @@ function getHtml(string $url, array $attributes = []): string {
|
||||
|
||||
if ($c_status != 200 || $c_error != '' || $html === false) {
|
||||
Minz_Log::warning('Error fetching content: HTTP code ' . $c_status . ': ' . $c_error . ' ' . $url);
|
||||
// TODO: Implement HTTP 410 Gone
|
||||
}
|
||||
if ($html == false) {
|
||||
$html = '';
|
||||
|
||||
Reference in new issue
Block a user