]> git.mxchange.org Git - friendica.git/commitdiff
Plaintext: The function now returns images from video links as well.
authorMichael Vogel <icarus@dabo.de>
Wed, 9 Jul 2014 19:28:42 +0000 (21:28 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 9 Jul 2014 19:28:42 +0000 (21:28 +0200)
include/plaintext.php

index 3d30a3299c9e5f18bedd7fd1dce0431d44ef3a97..4bbca636ce63397aa6340a3bb1b5142beb4ab38a 100644 (file)
@@ -95,6 +95,12 @@ function get_attached_data($body) {
                        $post["type"] = "text";
                        $post["text"] = trim($body);
                }
+       } elseif (isset($post["url"]) AND ($post["type"] == "video")) {
+               require_once("mod/parse_url.php");
+               $data = parseurl_getsiteinfo($post["url"], true);
+
+               if (isset($data["images"][0]))
+                       $post["image"] = $data["images"][0]["src"];
        }
 
        return($post);