From 72089a2be83293a32d169561714d63e694f73703 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 23 Jun 2016 20:25:00 +0200 Subject: [PATCH] wppost: Better title detection --- wppost/wppost.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wppost/wppost.php b/wppost/wppost.php index 5e197ab6..fc3d3a10 100755 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -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 == '') {