]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ParseUrl.php
Add ICacheDriver->getAllKeys method
[friendica.git] / src / Util / ParseUrl.php
index 5745c655951e0bc39e68cb64290d7a7732395f0a..00eac139026c1fe06a14d3f4ea129916ed492674 100644 (file)
@@ -161,14 +161,17 @@ class ParseUrl
                                        $siteinfo['type'] = $oembed_data->type;
                                }
 
-                               if (isset($oembed_data->title)) {
-                                       $siteinfo['title'] = trim($oembed_data->title);
-                               }
-                               if (isset($oembed_data->description)) {
-                                       $siteinfo['text'] = trim($oembed_data->description);
-                               }
-                               if (isset($oembed_data->thumbnail_url)) {
-                                       $siteinfo['image'] = $oembed_data->thumbnail_url;
+                               // See https://github.com/friendica/friendica/pull/5763#discussion_r217913178
+                               if ($siteinfo['type'] != 'photo') {
+                                       if (isset($oembed_data->title)) {
+                                               $siteinfo['title'] = trim($oembed_data->title);
+                                       }
+                                       if (isset($oembed_data->description)) {
+                                               $siteinfo['text'] = trim($oembed_data->description);
+                                       }
+                                       if (isset($oembed_data->thumbnail_url)) {
+                                               $siteinfo['image'] = $oembed_data->thumbnail_url;
+                                       }
                                }
                        }
                }
@@ -484,21 +487,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"];
                }