mirror of
https://github.com/friendica/friendica
synced 2025-01-24 20:59:47 +00:00
Merge pull request #14673 from annando/issue-14275
Issue 14275: Avoid "Data too long" error
This commit is contained in:
commit
07c4e606e1
1 changed files with 58 additions and 55 deletions
|
@ -323,6 +323,7 @@ class Photo
|
|||
$values = array_fill(0, count($fields), '');
|
||||
|
||||
$photo = array_combine($fields, $values);
|
||||
|
||||
$photo['data'] = $image_data;
|
||||
$photo['type'] = $mimetype ?: Images::getMimeTypeByData($image_data);
|
||||
$photo['cacheable'] = false;
|
||||
|
@ -476,6 +477,8 @@ class Photo
|
|||
'backend-ref' => $backend_ref
|
||||
];
|
||||
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('photo', $fields);
|
||||
|
||||
if (DBA::isResult($existing_photo)) {
|
||||
$r = DBA::update('photo', $fields, ['id' => $existing_photo['id']]);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue