aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-02-29 18:14:29 +0100
committerGravatar GitHub <noreply@github.com> 2020-02-29 18:14:29 +0100
commite9f879b411ac6af9d102702fb52c8deff161b0e6 (patch)
treeb9948017468fd483602b2a40f9e55ad599a7681a
parent0b6d39a7952e9dff98e977d1bcc13476910cde0c (diff)
Fallback to GUID when entry title is empty (#2813)
When entries have an empty title, our UI was a bit broken. In this (rare) case, we revert to GUID, which is always non-empty.
-rw-r--r--app/Models/Entry.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 45ff7b8c2..af130578f 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -43,7 +43,7 @@ class FreshRSS_Entry extends Minz_Model {
return $this->guid;
}
public function title() {
- return $this->title;
+ return $this->title == '' ? $this->guid() : $this->title;
}
public function author() {
//Deprecated
@@ -139,7 +139,7 @@ class FreshRSS_Entry extends Minz_Model {
}
public function _title($value) {
$this->hash = null;
- $this->title = $value;
+ $this->title = trim($value);
}
public function _author($value) {
//Deprecated