]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ParseUrl.php
Cleaned code
[friendica.git] / src / Util / ParseUrl.php
index ac13e1517447873ac2865050627fc3f7a0da7f05..00eac139026c1fe06a14d3f4ea129916ed492674 100644 (file)
@@ -161,7 +161,8 @@ class ParseUrl
                                        $siteinfo['type'] = $oembed_data->type;
                                }
 
-                               if (($oembed_data->type == 'link') && ($siteinfo['type'] != 'photo')) {
+                               // 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);
                                        }
@@ -337,7 +338,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 = [];