mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 08:03:41 +00:00
wppost: Better title detection
This commit is contained in:
parent
c900d8ea86
commit
72089a2be8
1 changed files with 4 additions and 3 deletions
|
@ -219,9 +219,10 @@ function wppost_send(&$a,&$b) {
|
|||
|
||||
// If the title is empty then try to guess
|
||||
if ($wptitle == '') {
|
||||
// Take the description from the bookmark
|
||||
if(preg_match("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/is",$b['body'],$matches))
|
||||
$wptitle = $matches[2];
|
||||
// Fetch information about the post
|
||||
$siteinfo = get_attached_data($b["body"]);
|
||||
if (isset($siteinfo["title"]))
|
||||
$wptitle = $siteinfo["title"];
|
||||
|
||||
// If no bookmark is found then take the first line
|
||||
if ($wptitle == '') {
|
||||
|
|
Loading…
Reference in a new issue