mirror of
https://github.com/friendica/friendica
synced 2025-04-19 06:30:10 +00:00
include suggested changes
This commit is contained in:
parent
6ef609f4fb
commit
d74e57ef2c
18 changed files with 64 additions and 67 deletions
|
@ -466,7 +466,7 @@ class APContact
|
|||
}
|
||||
|
||||
// Limit the length on incoming fields
|
||||
$apcontact = DI::dbaDefinition()->getFieldsForTable('apcontact', $apcontact);
|
||||
$apcontact = DI::dbaDefinition()->truncateFieldsForTable('apcontact', $apcontact);
|
||||
|
||||
if (DBA::exists('apcontact', ['url' => $apcontact['url']])) {
|
||||
DBA::update('apcontact', $apcontact, ['url' => $apcontact['url']]);
|
||||
|
|
|
@ -130,7 +130,7 @@ class User
|
|||
$fields['rel'] = Contact::SELF;
|
||||
}
|
||||
|
||||
return DI::dbaDefinition()->getFieldsForTable('user-contact', $fields);
|
||||
return DI::dbaDefinition()->truncateFieldsForTable('user-contact', $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2075,7 +2075,7 @@ class GServer
|
|||
*/
|
||||
public static function update(array $fields, array $condition): bool
|
||||
{
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('gserver', $fields);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('gserver', $fields);
|
||||
|
||||
return DBA::update('gserver', $fields, $condition);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class Post
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -525,7 +525,7 @@ class Post
|
|||
// To ensure the data integrity we do it in an transaction
|
||||
DBA::transaction();
|
||||
|
||||
$update_fields = DI::dbaDefinition()->getFieldsForTable('post-user', $fields);
|
||||
$update_fields = DI::dbaDefinition()->truncateFieldsForTable('post-user', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$affected_count = 0;
|
||||
$posts = DBA::select('post-user-view', ['post-user-id'], $condition);
|
||||
|
@ -542,7 +542,7 @@ class Post
|
|||
$affected = $affected_count;
|
||||
}
|
||||
|
||||
$update_fields = DI::dbaDefinition()->getFieldsForTable('post-content', $fields);
|
||||
$update_fields = DI::dbaDefinition()->truncateFieldsForTable('post-content', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$affected_count = 0;
|
||||
$posts = DBA::select('post-user-view', ['uri-id'], $condition, ['group_by' => ['uri-id']]);
|
||||
|
@ -559,7 +559,7 @@ class Post
|
|||
$affected = max($affected, $affected_count);
|
||||
}
|
||||
|
||||
$update_fields = DI::dbaDefinition()->getFieldsForTable('post', $fields);
|
||||
$update_fields = DI::dbaDefinition()->truncateFieldsForTable('post', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$affected_count = 0;
|
||||
$posts = DBA::select('post-user-view', ['uri-id'], $condition, ['group_by' => ['uri-id']]);
|
||||
|
@ -593,7 +593,7 @@ class Post
|
|||
$affected = max($affected, $affected_count);
|
||||
}
|
||||
|
||||
$update_fields = DI::dbaDefinition()->getFieldsForTable('post-thread', $fields);
|
||||
$update_fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$affected_count = 0;
|
||||
$posts = DBA::select('post-user-view', ['uri-id'], $thread_condition, ['group_by' => ['uri-id']]);
|
||||
|
@ -610,7 +610,7 @@ class Post
|
|||
$affected = max($affected, $affected_count);
|
||||
}
|
||||
|
||||
$update_fields = DI::dbaDefinition()->getFieldsForTable('post-thread-user', $fields);
|
||||
$update_fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread-user', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$affected_count = 0;
|
||||
$posts = DBA::select('post-user-view', ['post-user-id'], $thread_condition);
|
||||
|
|
|
@ -45,7 +45,7 @@ class Content
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-content', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-content', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -68,7 +68,7 @@ class Content
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-content', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-content', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -52,7 +52,7 @@ class History
|
|||
}
|
||||
|
||||
$update = false;
|
||||
$changed = DI::dbaDefinition()->getFieldsForTable('post-history', $item);
|
||||
$changed = DI::dbaDefinition()->truncateFieldsForTable('post-history', $item);
|
||||
unset($changed['uri-id']);
|
||||
unset($changed['edited']);
|
||||
foreach ($changed as $field => $content) {
|
||||
|
|
|
@ -43,7 +43,7 @@ class Question
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-question', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-question', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -44,7 +44,7 @@ class QuestionOption
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-question-option', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-question-option', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -43,7 +43,7 @@ class Thread
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-thread', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -66,7 +66,7 @@ class Thread
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-thread', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -44,7 +44,7 @@ class ThreadUser
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-thread-user', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread-user', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -69,7 +69,7 @@ class ThreadUser
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-thread-user', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread-user', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -48,7 +48,7 @@ class User
|
|||
return false;
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-user', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -82,7 +82,7 @@ class User
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-user', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
|
@ -67,7 +67,7 @@ class UserNotification
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user-notification', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-user-notification', $data);
|
||||
|
||||
$fields['uri-id'] = $uri_id;
|
||||
$fields['uid'] = $uid;
|
||||
|
@ -91,7 +91,7 @@ class UserNotification
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user-notification', $data);
|
||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('post-user-notification', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue