aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-x[-rw-r--r--]app/Controllers/feedController.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 3f4ed3149..9c4860521 100644..100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -385,7 +385,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
* list of feeds for which a cache refresh is needed
* @throws FreshRSS_BadUrl_Exception
*/
- public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url = null, ?int $maxFeeds = null, ?SimplePie $simplePiePush = null): array {
+ public static function actualizeFeeds(?int $feed_id = null, ?string $feed_url = null, ?int $maxFeeds = null,
+ ?\SimplePie\SimplePie $simplePiePush = null): array {
if (function_exists('set_time_limit')) {
@set_time_limit(300);
}
@@ -443,6 +444,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
$url = $feed->url(); //For detection of HTTP 301
+ $oldSimplePieHash = $feed->attributeString('SimplePieHash');
$pubSubHubbubEnabled = $pubsubhubbubEnabledGeneral && $feed->pubSubHubbubEnabled();
if ($simplePiePush === null && $feed_id === null && $pubSubHubbubEnabled && ($feed->lastUpdate() > $pshbMinAge)) {
@@ -619,7 +621,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if ($pubSubHubbubEnabled && $simplePiePush === null) { //We use push, but have discovered an article by pull!
$text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' .
- SimplePie_Misc::url_remove_credentials($url) .
+ \SimplePie\Misc::url_remove_credentials($url) .
' GUID ' . $entry->guid();
Minz_Log::warning($text, PSHB_LOG);
Minz_Log::warning($text);
@@ -657,6 +659,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
$feedProperties = [];
+ if ($oldSimplePieHash !== $feed->attributeString('SimplePieHash')) {
+ $feedProperties['attributes'] = $feed->attributes();
+ }
if ($pubsubhubbubEnabledGeneral && $feed->hubUrl() !== '' && $feed->selfUrl() !== '') { //selfUrl has priority for WebSub
if ($feed->selfUrl() !== $url) { // https://github.com/pubsubhubbub/PubSubHubbub/wiki/Moving-Feeds-or-changing-Hubs
@@ -672,8 +677,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
}
} elseif ($feed->url() !== $url) { // HTTP 301 Moved Permanently
- Minz_Log::notice('Feed ' . SimplePie_Misc::url_remove_credentials($url) .
- ' moved permanently to ' . SimplePie_Misc::url_remove_credentials($feed->url(false)));
+ Minz_Log::notice('Feed ' . \SimplePie\Misc::url_remove_credentials($url) .
+ ' moved permanently to ' . \SimplePie\Misc::url_remove_credentials($feed->url(false)));
$feedProperties['url'] = $feed->url();
}
@@ -798,7 +803,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
* list of feeds for which a cache refresh is needed
* @throws FreshRSS_BadUrl_Exception
*/
- public static function actualizeFeedsAndCommit(?int $feed_id = null, ?string $feed_url = null, ?int $maxFeeds = null, ?SimplePie $simplePiePush = null): array {
+ public static function actualizeFeedsAndCommit(?int $feed_id = null, ?string $feed_url = null, ?int $maxFeeds = null,
+ ?SimplePie\SimplePie $simplePiePush = null): array {
$entryDAO = FreshRSS_Factory::createEntryDao();
[$nbUpdatedFeeds, $feed, $nbNewArticles, $feedsCacheToRefresh] = FreshRSS_feed_Controller::actualizeFeeds($feed_id, $feed_url, $maxFeeds, $simplePiePush);
if ($nbNewArticles > 0) {