]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Media.php
Merge pull request #11526 from annando/ap-endpoint-cache
[friendica.git] / src / Model / Post / Media.php
index b783fb6a4fc6c8532c1c2a639ea82c9b7952dce2..78f27b7a099252380b09821bc3c170d9f2dd17a3 100644 (file)
@@ -547,12 +547,17 @@ class Media
         * @param int    $uri_id
         * @param string $guid
         * @param array  $links list of links that shouldn't be added
+        * @param bool   $has_media
         * @return array attachments
         */
-       public static function splitAttachments(int $uri_id, string $guid = '', array $links = [])
+       public static function splitAttachments(int $uri_id, string $guid = '', array $links = [], bool $has_media = true)
        {
                $attachments = ['visual' => [], 'link' => [], 'additional' => []];
 
+               if (!$has_media) {
+                       return $attachments;
+               }
+
                $media = self::getByURIId($uri_id);
                if (empty($media)) {
                        return $attachments;