aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2017-09-23 12:32:35 +0200
committerGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2017-09-23 12:32:35 +0200
commit28db5dd2858002b376c920ec1d1aaad4ef254d54 (patch)
tree4310b06531acb71792fb2ae290aad528fa06f22a /app/Controllers/feedController.php
parent3fa63217cdf339b894c29ffe7f9af8c477c724fb (diff)
Fix SQL constraint insert into entrytmp table
https://github.com/FreshRSS/FreshRSS/issues/1614
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 66b1167a8..45cba9e98 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -320,11 +320,16 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
// For this feed, check existing GUIDs already in database.
$existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids);
- unset($newGuids);
+ $newGuids = array();
$oldGuids = array();
// Add entries in database if possible.
foreach ($entries as $entry) {
+ if (isset($newGuids[$entry->guid()])) {
+ continue; //Skip subsequent articles with same GUID
+ }
+ $newGuids[$entry->guid()] = true;
+
$entry_date = $entry->date(true);
if (isset($existingHashForGuids[$entry->guid()])) {
$existingHash = $existingHashForGuids[$entry->guid()];