From 6130ba6157fc214579a0466ec122a8f085224415 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 26 Nov 2013 23:52:53 +0100 Subject: SQL : utilisation de (id_feed, guid) pour l'unicité MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Préparation avant https://github.com/marienfressinaud/FreshRSS/issues/202 --- app/models/Entry.php | 6 +++--- app/models/Feed.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/models') diff --git a/app/models/Entry.php b/app/models/Entry.php index e2493e266..abf381a9b 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -565,9 +565,9 @@ class EntryDAO extends Model_pdo { public function listByFeed ($feed, $state, $order = 'high_to_low', $limitFromId = '', $limitCount = '') { return $this->listWhere (' WHERE id_feed = ?', $state, $order, $limitFromId, $limitCount, array ($feed)); } - - public function listLastIdsByFeed($id, $n) { - $sql = 'SELECT id FROM ' . $this->prefix . 'entry WHERE id_feed=? ORDER BY date DESC LIMIT ' . intval($n); + + public function listLastGuidsByFeed($id, $n) { + $sql = 'SELECT guid FROM ' . $this->prefix . 'entry WHERE id_feed=? ORDER BY date DESC LIMIT ' . intval($n); $stm = $this->bd->prepare ($sql); $values = array ($id); $stm->execute ($values); diff --git a/app/models/Feed.php b/app/models/Feed.php index 822f6e703..d1d85d838 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -191,7 +191,7 @@ class Feed extends Model { } else { $feed = new SimplePie (); $feed->set_useragent(Translate::t ('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); - $url = str_replace ('&', '&', $this->url); + $url = htmlspecialchars_decode ($this->url, ENT_QUOTES); if ($this->httpAuth != '') { $url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); } -- cgit v1.2.3