mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:42:53 +00:00
Merge pull request #7845 from annando/diaspora-title
Show title for posts with attached pages
This commit is contained in:
commit
d62cd5defc
1 changed files with 9 additions and 1 deletions
|
@ -3584,6 +3584,14 @@ class Diaspora
|
|||
$title = $item["title"];
|
||||
$body = $item["body"];
|
||||
|
||||
// Fetch the title from an attached link - if there is one
|
||||
if (empty($item["title"])) {
|
||||
$page_data = BBCode::getAttachmentData($item['body']);
|
||||
if (!empty($page_data['type']) && !empty($page_data['title']) && ($page_data['type'] == 'link')) {
|
||||
$title = $page_data['title'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($item['author-link'] != $item['owner-link']) {
|
||||
require_once 'mod/share.php';
|
||||
$body = share_header($item['author-name'], $item['author-link'], $item['author-avatar'],
|
||||
|
@ -3595,7 +3603,7 @@ class Diaspora
|
|||
|
||||
// Adding the title
|
||||
if (strlen($title)) {
|
||||
$body = "## ".html_entity_decode($title)."\n\n".$body;
|
||||
$body = "### ".html_entity_decode($title)."\n\n".$body;
|
||||
}
|
||||
|
||||
if ($item["attach"]) {
|
||||
|
|
Loading…
Reference in a new issue