]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
The Diaspora class is now productive
[friendica.git] / mod / parse_url.php
index 1ca5dc1dacfe60cac9646b6adc913a6a565b26a5..a1ca5a3db5e2e1c831d35bada4b52a3502b54183 100644 (file)
@@ -80,6 +80,7 @@ function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = tr
 
 function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
        require_once("include/network.php");
+       require_once("include/Photo.php");
 
        $a = get_app();
 
@@ -330,7 +331,7 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
                        $attr[$attribute->name] = $attribute->value;
 
                        $src = completeurl($attr["src"], $url);
-                       $photodata = @getimagesize($src);
+                       $photodata = get_photo_info($src);
 
                        if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) {
                                if ($photodata[0] > 300) {
@@ -347,12 +348,12 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
                        }
 
                }
-    } else {
+    } elseif ($siteinfo["image"] != "") {
                $src = completeurl($siteinfo["image"], $url);
 
                unset($siteinfo["image"]);
 
-               $photodata = @getimagesize($src);
+               $photodata = get_photo_info($src);
 
                if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10))
                        $siteinfo["images"][] = array("src"=>$src,