From be016b0c458a6e50b529d850332243c7997cc67e Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 22 Mar 2022 07:00:44 +0000 Subject: [PATCH 1/2] Prioritize the title over the content warning --- src/Content/Conversation.php | 6 +++--- src/Object/Post.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 48265ce51..ac37a3a8b 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -631,10 +631,10 @@ class Conversation [$categories, $folders] = $this->item->determineCategoriesTerms($item, local_user()); - if (!empty($item['content-warning']) && $this->pConfig->get(local_user(), 'system', 'disable_cw', false)) { - $title = ucfirst($item['content-warning']); - } else { + if (!empty($item['title'])) { $title = $item['title']; + } elseif (!empty($item['content-warning']) && $this->pConfig->get(local_user(), 'system', 'disable_cw', false)) { + $title = ucfirst($item['content-warning']); } $tmp_item = [ diff --git a/src/Object/Post.php b/src/Object/Post.php index 253b4b4f1..b5c058dfd 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -389,10 +389,10 @@ class Post list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user()); - if (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { - $title = ucfirst($item['content-warning']); - } else { + if (!empty($item['title'])) { $title = $item['title']; + } elseif (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { + $title = ucfirst($item['content-warning']); } if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) { From 13addaf9011ea85217b6fde86841d6e9f499f08b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 22 Mar 2022 07:07:33 +0000 Subject: [PATCH 2/2] Always provide the title variable --- src/Content/Conversation.php | 2 ++ src/Object/Post.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index ac37a3a8b..0c3a6c988 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -635,6 +635,8 @@ class Conversation $title = $item['title']; } elseif (!empty($item['content-warning']) && $this->pConfig->get(local_user(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); + } else { + $title = ''; } $tmp_item = [ diff --git a/src/Object/Post.php b/src/Object/Post.php index b5c058dfd..4e0d8d238 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -393,6 +393,8 @@ class Post $title = $item['title']; } elseif (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); + } else { + $title = ''; } if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) {