]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
Frost-mobile: media query in css for tablets
[friendica.git] / mod / parse_url.php
index 0610531967db8e92b1d2587ce9aeb06c6809a8a8..ea05055f0cefc69b461c29b5e009786320bcc2b8 100644 (file)
@@ -176,6 +176,9 @@ function parseurl_getsiteinfo($url) {
                 }
         } else {
                $src = completeurl($siteinfo["image"], $url);
+
+               unset($siteinfo["image"]);
+
                $photodata = getimagesize($src);
 
                if (($photodata[0] > 10) and ($photodata[1] > 10))
@@ -292,8 +295,7 @@ function parse_url_content(&$a) {
        $siteinfo = parseurl_getsiteinfo($url);
 
        if($siteinfo["title"] == "") {
-               echo print_r($siteinfo, true);
-               //echo sprintf($template,$url,$url,'') . $str_tags;
+               echo sprintf($template,$url,$url,'') . $str_tags;
                killme();
        } else {
                $text = $siteinfo["text"];
@@ -302,11 +304,16 @@ function parse_url_content(&$a) {
 
        $image = "";
 
-       foreach ($siteinfo["images"] as $imagedata)
+        if(sizeof($siteinfo["images"]) > 0){
+            /*
+              Execute below code only if image is present in siteinfo
+             */
+            foreach ($siteinfo["images"] as $imagedata)
                if($textmode)
-                       $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]';
+                    $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]';
                else
-                       $image .= '<img height="'.$imagedata["height"].'" width="'.$imagedata["width"].'" src="'.$imagedata["src"].'" alt="photo" />';
+                    $image .= '<img height="'.$imagedata["height"].'" width="'.$imagedata["width"].'" src="'.$imagedata["src"].'" alt="photo" />';
+        }
 
        if(strlen($text)) {
                if($textmode)