return $itemuri['id'] ?? 0;
}
+
+ /**
+ * @param int $uriId
+ * @return bool
+ * @throws \Exception
+ */
+ public static function exists(int $uriId): bool
+ {
+ return DBA::exists('item-uri', ['id' => $uriId]);
+ }
}
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
+use Friendica\Model\ItemURI;
use Friendica\Model\Photo;
use Friendica\Model\Post;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
return;
}
+ if (!ItemURI::exists($media['uri-id'])) {
+ Logger::info('Media referenced URI ID not found', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'callstack' => System::callstack()]);
+ return;
+ }
+
$media = self::unsetEmptyFields($media);
$media = DI::dbaDefinition()->truncateFieldsForTable('post-media', $media);