]> git.mxchange.org Git - friendica.git/commitdiff
Only display redundant preview data with preview picture
authorMichael <heluecht@pirati.ca>
Sat, 19 Sep 2020 19:02:40 +0000 (19:02 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 19 Sep 2020 19:02:40 +0000 (19:02 +0000)
src/Content/PageInfo.php

index e4d9207c8c43eaaf7b066978e52b865439d9b7c1..d301c4d04d729352c58d932b698dddd0a3d623dc 100644 (file)
@@ -134,14 +134,6 @@ class PageInfo
 
                $text = "[attachment type='" . $data['type'] . "'";
 
-               if (empty($data['text'])) {
-                       $data['text'] = $data['title'];
-               }
-
-               if (empty($data['text'])) {
-                       $data['text'] = $data['url'];
-               }
-
                if (!empty($data['url'])) {
                        $text .= " url='" . $data['url'] . "'";
                }
@@ -160,6 +152,14 @@ class PageInfo
                                $text .= " image='" . $preview . "'";
                        } else {
                                $text .= " preview='" . $preview . "'";
+
+                               if (empty($data['text'])) {
+                                       $data['text'] = $data['title'];
+                               }
+               
+                               if (empty($data['text'])) {
+                                       $data['text'] = $data['url'];
+                               }
                        }
                }