]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ParseUrl.php
Remove references to pear/Text_Highlighter
[friendica.git] / src / Util / ParseUrl.php
index dd39a052a0c529bfccfa4248174848264bec1c16..ac13e1517447873ac2865050627fc3f7a0da7f05 100644 (file)
@@ -333,7 +333,7 @@ class ParseUrl
                }
 
                // Prevent to have a photo type without an image
-               if (empty($siteinfo['image']) && ($siteinfo['type'] == 'photo')) {
+               if ((empty($siteinfo['image']) || !empty($siteinfo['text'])) && ($siteinfo['type'] == 'photo')) {
                        $siteinfo['type'] = 'link';
                }
 
@@ -486,21 +486,23 @@ class ParseUrl
 
                $complete = $schemearr["scheme"]."://".$schemearr["host"];
 
-               if (@$schemearr["port"] != "") {
+               if (!empty($schemearr["port"])) {
                        $complete .= ":".$schemearr["port"];
                }
 
-               if (strpos($urlarr["path"], "/") !== 0) {
-                       $complete .= "/";
-               }
+               if (!empty($urlarr["path"])) {
+                       if (strpos($urlarr["path"], "/") !== 0) {
+                               $complete .= "/";
+                       }
 
-               $complete .= $urlarr["path"];
+                       $complete .= $urlarr["path"];
+               }
 
-               if (@$urlarr["query"] != "") {
+               if (!empty($urlarr["query"])) {
                        $complete .= "?".$urlarr["query"];
                }
 
-               if (@$urlarr["fragment"] != "") {
+               if (!empty($urlarr["fragment"])) {
                        $complete .= "#".$urlarr["fragment"];
                }