aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-06-16 09:59:46 +0200
committerGravatar GitHub <noreply@github.com> 2018-06-16 09:59:46 +0200
commit3306a1679c2570c30d4b662c887b4a71ce147398 (patch)
tree35fb1616c1166723676c789d6127a98db3260148 /app/Controllers
parentc0122003fe3031926546012b86a38b5187082613 (diff)
parent8fcacc8cf41c14dd7d9712329d75ff4f041f3caf (diff)
Merge pull request #1921 from FreshRSS/dev1.11.1
FreshRSS 1.11.1
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/extensionController.php8
-rwxr-xr-xapp/Controllers/feedController.php9
2 files changed, 14 insertions, 3 deletions
diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php
index 311fd2e96..806e5a696 100644
--- a/app/Controllers/extensionController.php
+++ b/app/Controllers/extensionController.php
@@ -140,7 +140,7 @@ class FreshRSS_extension_Controller extends Minz_ActionController {
if ($res === true) {
$ext_list = $conf->extensions_enabled;
- array_push_unique($ext_list, $ext_name);
+ $ext_list[$ext_name] = true;
$conf->extensions_enabled = $ext_list;
$conf->save();
@@ -196,7 +196,11 @@ class FreshRSS_extension_Controller extends Minz_ActionController {
if ($res === true) {
$ext_list = $conf->extensions_enabled;
- array_remove($ext_list, $ext_name);
+ $legacyKey = array_search($ext_name, $ext_list, true);
+ if ($legacyKey !== false) { //Legacy format FreshRSS < 1.11.1
+ unset($ext_list[$legacyKey]);
+ }
+ $ext_list[$ext_name] = false;
$conf->extensions_enabled = $ext_list;
$conf->save();
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();
}