Merge pull request #13982 from annando/no-unknown-media

Fix: Don't attach unknown media
This commit is contained in:
Tobias Diekershoff 2024-03-10 14:28:14 +01:00 committed by GitHub
commit e22ef85386
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,7 @@ use Friendica\Content\Post\Collection;
use Friendica\Content\Post\Entity;
use Friendica\Content\Post\Factory;
use Friendica\Database\Database;
use Friendica\Model\Post;
use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
@ -62,7 +63,7 @@ class PostMedia extends BaseRepository
public function selectByUriId(int $uriId): Collection\PostMedias
{
return $this->_select(['uri-id' => $uriId]);
return $this->_select(["`uri-id` = ? AND `type` != ?", $uriId, Post\Media::UNKNOWN]);
}
public function save(Entity\PostMedia $PostMedia): Entity\PostMedia