]> git.mxchange.org Git - friendica.git/commitdiff
Use OEmbed data when available no matter the type
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 14 Sep 2018 01:50:52 +0000 (21:50 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 14 Sep 2018 01:50:52 +0000 (21:50 -0400)
src/Util/ParseUrl.php

index 40cb0b8fc099eaa42763fd4ddbd06ecd062d1185..5745c655951e0bc39e68cb64290d7a7732395f0a 100644 (file)
@@ -161,16 +161,14 @@ class ParseUrl
                                        $siteinfo['type'] = $oembed_data->type;
                                }
 
-                               if (($oembed_data->type == 'link') && ($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;
-                                       }
+                               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;
                                }
                        }
                }
@@ -337,7 +335,7 @@ class ParseUrl
                        $siteinfo['type'] = 'link';
                }
 
-               if ((@$siteinfo['image'] == '') && !$no_guessing) {
+               if (empty($siteinfo['image']) && !$no_guessing) {
                        $list = $xpath->query('//img[@src]');
                        foreach ($list as $node) {
                                $img_tag = [];