mirror of
https://github.com/friendica/friendica
synced 2025-04-25 20:30:11 +00:00
Issue 9926: Limit the length of data to store in the apcontact table
This commit is contained in:
parent
87c1533516
commit
da8d5f5015
2 changed files with 8 additions and 0 deletions
|
@ -241,6 +241,10 @@ class DBStructure
|
|||
// Assign all field that are present in the table
|
||||
foreach ($fieldnames as $field) {
|
||||
if (isset($data[$field])) {
|
||||
// Limit the length of varchar, varbinary, char and binrary fields
|
||||
if (is_string($data[$field]) && preg_match("/[char|binary]\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {
|
||||
$data[$field] = mb_substr($data[$field], 0, $result[1]);
|
||||
}
|
||||
$fields[$field] = $data[$field];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue