]> git.mxchange.org Git - friendica-addons.git/commitdiff
wppost: Better title detection
authorMichael Vogel <icarus@dabo.de>
Thu, 23 Jun 2016 18:25:00 +0000 (20:25 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 23 Jun 2016 18:25:00 +0000 (20:25 +0200)
wppost/wppost.php

index 5e197ab65c96b9f00a75597fdea4f348bd9976ef..fc3d3a10acccd1058099181e7619956834426e4b 100755 (executable)
@@ -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 == '') {