aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-08-19 15:36:32 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-08-19 15:36:32 +0200
commit2fa8fdd28e058c818881a593df59700dcb96becd (patch)
tree6e4250f60a770e61a480e9b41860c4d4600e5dee /app/Models
parent5d4e4a8dd0702e42088bd93dca2158a3cb05b7a4 (diff)
parent19df77c249f23f00d247799ca9deaf4fd923e2bf (diff)
Merge branch 'FreshRSS/dev' into cli_update_user
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/EntryDAOPGSQL.php5
-rw-r--r--app/Models/Feed.php2
2 files changed, 5 insertions, 2 deletions
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php
index b25993c47..6e6f9e658 100644
--- a/app/Models/EntryDAOPGSQL.php
+++ b/app/Models/EntryDAOPGSQL.php
@@ -30,7 +30,10 @@ maxrank bigint := (SELECT MAX(id) FROM `' . $this->prefix . 'entrytmp`);
rank bigint := (SELECT maxrank - COUNT(*) FROM `' . $this->prefix . 'entrytmp`);
BEGIN
INSERT INTO `' . $this->prefix . 'entry` (id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags)
- (SELECT rank + row_number() OVER(ORDER BY date) AS id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags FROM `' . $this->prefix . 'entrytmp` ORDER BY date);
+ (SELECT rank + row_number() OVER(ORDER BY date) AS id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags
+ FROM `' . $this->prefix . 'entrytmp` AS etmp
+ WHERE NOT EXISTS (SELECT 1 FROM `' . $this->prefix . 'entry` AS ereal WHERE etmp.id_feed = ereal.id_feed AND etmp.guid = ereal.guid)
+ ORDER BY date);
DELETE FROM `' . $this->prefix . 'entrytmp` WHERE id <= maxrank;
END $$;';
$hadTransaction = $this->bd->inTransaction();
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 52d49db6e..4f11d32e9 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -339,7 +339,7 @@ class FreshRSS_Feed extends Minz_Model {
$this->id(),
$item->get_id(false, false),
$title === null ? '' : $title,
- $author === null ? '' : html_only_entity_decode($author->name),
+ $author === null ? '' : html_only_entity_decode(strip_tags($author->name)),
$content === null ? '' : $content,
$link === null ? '' : $link,
$date ? $date : time()