summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-05 15:50:31 +0200
committerGravatar GitHub <noreply@github.com> 2017-04-05 15:50:31 +0200
commit658dc02d10b31331b5fb841589ef372c500962fd (patch)
treeac0b7d6010d95f78d220b3dfc498dc4401895134
parent730649971cc9a8b2e0b4565014730f992130fcec (diff)
parent3375ca66340fdeeef52846ca7824e7176641dfd9 (diff)
Merge pull request #1483 from Alkarex/guid-or-title
Fallback when GUID is empty
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/Models/Entry.php8
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04cff5680..c8207a712 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@
* (Require manual update for existing installations)
* I18n
* Improve English [#1465](https://github.com/FreshRSS/FreshRSS/pull/1465)
+* Misc.
+ * Fall back to article URL when the article GUID is empty [#1482](https://github.com/FreshRSS/FreshRSS/issues/1482)
## 2017-03-11 FreshRSS 1.6.3
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index a562a963a..26cd24797 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -22,7 +22,6 @@ class FreshRSS_Entry extends Minz_Model {
public function __construct($feed = '', $guid = '', $title = '', $author = '', $content = '',
$link = '', $pubdate = 0, $is_read = false, $is_favorite = false, $tags = '') {
- $this->_guid($guid);
$this->_title($title);
$this->_author($author);
$this->_content($content);
@@ -32,6 +31,7 @@ class FreshRSS_Entry extends Minz_Model {
$this->_isFavorite($is_favorite);
$this->_feed($feed);
$this->_tags(preg_split('/[\s#]/', $tags));
+ $this->_guid($guid);
}
public function id() {
@@ -101,6 +101,12 @@ class FreshRSS_Entry extends Minz_Model {
$this->id = $value;
}
public function _guid($value) {
+ if ($value == '') {
+ $value = $this->link;
+ if ($value == '') {
+ $value = $this->hash();
+ }
+ }
$this->guid = $value;
}
public function _title($value) {