mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-24 16:25:00 -04:00
Fix entry_before_insert hook
The hook must be called also in: - feedController->addAction() - importExportController->importJson() See https://github.com/FreshRSS/FreshRSS/issues/252
This commit is contained in:
@@ -174,10 +174,17 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
$feedDAO->beginTransaction();
|
||||
foreach ($entries as $entry) {
|
||||
// Entries are added without any verification.
|
||||
$entry->_feed($feed->id());
|
||||
$entry->_id(min(time(), $entry->date(true)) . uSecString());
|
||||
$entry->_isRead($is_read);
|
||||
|
||||
$entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry);
|
||||
if (is_null($entry)) {
|
||||
// An extension has returned a null value, there is nothing to insert.
|
||||
continue;
|
||||
}
|
||||
|
||||
$values = $entry->toArray();
|
||||
$values['id_feed'] = $feed->id();
|
||||
$values['id'] = min(time(), $entry->date(true)) . uSecString();
|
||||
$values['is_read'] = $is_read;
|
||||
$entryDAO->addEntry($values, $prepared_statement);
|
||||
}
|
||||
$feedDAO->updateLastUpdate($feed->id());
|
||||
|
||||
Reference in New Issue
Block a user