mirror of
https://github.com/friendica/friendica
synced 2025-04-27 20:30:13 +00:00
Check for URI ID existence in Post\Media::insert
- Address https://github.com/friendica/friendica/issues/12486#issuecomment-1374538325
This commit is contained in:
parent
4d5d8e5b64
commit
b77f3a7525
2 changed files with 16 additions and 0 deletions
|
@ -30,6 +30,7 @@ use Friendica\Database\DBA;
|
|||
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;
|
||||
|
@ -89,6 +90,11 @@ class Media
|
|||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue