X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fplaintext.php;h=eb33d16e968f8ecc52e3fc84014ab6e6f9379e85;hb=2f89a9b3e8c8028ef9dd0bdc8cd8611e5d67903d;hp=3d30a3299c9e5f18bedd7fd1dce0431d44ef3a97;hpb=83ac685deb7f710989aa713146a090b4df89d913;p=friendica.git diff --git a/include/plaintext.php b/include/plaintext.php index 3d30a3299c..eb33d16e96 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -53,7 +53,6 @@ function get_attached_data($body) { if (count($pictures) == 1) { // Checking, if the link goes to a picture $data = parseurl_getsiteinfo($pictures[0][1], true); - if ($data["type"] == "photo") { $post["type"] = "photo"; if (isset($data["images"][0])) @@ -64,8 +63,7 @@ function get_attached_data($body) { $post["preview"] = $pictures[0][2]; $post["text"] = str_replace($pictures[0][0], "", $body); } else { - $img_str = fetch_url($pictures[0][1]); - $imgdata = get_photo_info($img_str); + $imgdata = get_photo_info($pictures[0][1]); if (substr($imgdata["mime"], 0, 6) == "image/") { $post["type"] = "photo"; $post["image"] = $pictures[0][1]; @@ -95,6 +93,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);