From 4c390fa6b045d145fcc79efc9e77b06ff40df08c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 30 Oct 2014 10:25:52 +0100 Subject: dont generate guid hash by hashing the guid since picofeed already hashes the guid in all cases --- db/item.php | 4 +++- tests/unit/db/ItemTest.php | 2 +- tests/unit/fetcher/FeedFetcherTest.php | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/item.php b/db/item.php index 8a8b19e59..452075d05 100644 --- a/db/item.php +++ b/db/item.php @@ -204,7 +204,9 @@ class Item extends Entity implements IAPI, \JsonSerializable { public function setGuid($guid) { parent::setGuid($guid); - $this->setGuidHash(md5($guid)); + + // not needed to hash again because picofeed hashes the id anyways + $this->setGuidHash($guid); } diff --git a/tests/unit/db/ItemTest.php b/tests/unit/db/ItemTest.php index 2739baabd..6d1a1d87a 100644 --- a/tests/unit/db/ItemTest.php +++ b/tests/unit/db/ItemTest.php @@ -263,7 +263,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase { public function testSetGuidUpdatesHash() { $item = new Item(); $item->setGuid('http://test'); - $this->assertEquals(md5('http://test'), $item->getGuidHash()); + $this->assertEquals('http://test', $item->getGuidHash()); } diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php index ed697a8cf..fad468d7a 100644 --- a/tests/unit/fetcher/FeedFetcherTest.php +++ b/tests/unit/fetcher/FeedFetcherTest.php @@ -192,7 +192,6 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { $item->setUrl($this->permalink); $item->setTitle('my<\' title'); $item->setGuid($this->guid); - $item->setGuidHash(md5($this->guid)); $item->setBody($this->body); $item->setLastModified($this->time); -- cgit v1.2.3