diff options
-rw-r--r-- | templates/part.items.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/templates/part.items.php b/templates/part.items.php index 72cf8393c..ebfe76b4f 100644 --- a/templates/part.items.php +++ b/templates/part.items.php @@ -34,13 +34,19 @@ foreach($items as $item) { echo '<h1 class="item_title"><a target="_blank" href="' . $item->getUrl() . '">' . htmlspecialchars($item->getTitle(), ENT_QUOTES, 'UTF-8') . '</a></h1>'; if ((int)$lastViewedFeedType !== OCA\News\FeedType::FEED) { - $feedTitle = '<span class="from_feed"> ' . $l->t('from') . ' ' . $item->getFeedTitle() . '</span>'; + $feedTitle = '<span class="from_feed"> ' . $l->t('from') . ' ' . $item->getFeedTitle() . '</span> '; } else { $feedTitle = ''; } - if(($item->getAuthor() !== null) && (trim($item->getAuthor()) != '')) { - echo '<h2 class="item_author">'. $feedTitle . $l->t('by') . ' ' . htmlspecialchars($item->getAuthor(), ENT_QUOTES, 'UTF-8') . '</h2>'; + if(($item->getAuthor() !== null) && (trim($item->getAuthor()) !== '')) { + $author = $l->t('by') . ' ' . htmlspecialchars($item->getAuthor(), ENT_QUOTES, 'UTF-8'); + } else { + $author = ''; + } + + if(!($feedTitle === '' && $author === '')){ + echo '<h2 class="item_author">'. $feedTitle . $author . '</h2>'; } echo '<div class="body">' . $item->getBody() . '</div>'; |