summaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-06-13 09:27:02 +0200
committerGravatar GitHub <noreply@github.com> 2018-06-13 09:27:02 +0200
commit031acde003b85ae34a4996d0c02fdc41ffae5515 (patch)
treeec6817aaff32613856330a50058b1fa642cfc778 /app/Controllers/feedController.php
parentc0f2df3ef0de33e9b07269f6db887c373e45192e (diff)
Fix extension hook for updated articles (#1932)
* Fix extension hook for updated articles https://github.com/FreshRSS/FreshRSS/issues/1926 * Enable extensions during PubSubHubbub * A little array protection * Changelog 1926 https://github.com/FreshRSS/FreshRSS/issues/1926 https://github.com/FreshRSS/FreshRSS/pull/1932 * Add null check
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index ca85e7cb8..ec88156f9 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -351,13 +351,20 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
//This entry already exists and is unchanged. TODO: Remove the test with the zero'ed hash in FreshRSS v1.3
$oldGuids[] = $entry->guid();
} else { //This entry already exists but has been updated
- //Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->id() .
+ //Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->url() .
//', old hash ' . $existingHash . ', new hash ' . $entry->hash());
$mark_updated_article_unread = $feed->attributes('mark_updated_article_unread') !== null ? (
$feed->attributes('mark_updated_article_unread')
) : FreshRSS_Context::$user_conf->mark_updated_article_unread;
$needFeedCacheRefresh = $mark_updated_article_unread;
$entry->_isRead(FreshRSS_Context::$user_conf->mark_updated_article_unread ? false : null); //Change is_read according to policy.
+
+ $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry);
+ if ($entry === null) {
+ // An extension has returned a null value, there is nothing to insert.
+ continue;
+ }
+
if (!$entryDAO->inTransaction()) {
$entryDAO->beginTransaction();
}