From dd8279afc23e39310897cb6b25170e835ee378f8 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 25 Aug 2022 18:47:07 +0000 Subject: [PATCH] Some more protection against database errors --- src/Model/Contact.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 6066261928..8c8a25b6d4 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -160,6 +160,7 @@ class Contact $fields['created'] = DateTimeFormat::utcNow(); } + $fields = DI::dbaDefinition()->truncateFieldsForTable('contact', $fields); DBA::insert('contact', $fields, $duplicate_mode); $contact = DBA::selectFirst('contact', [], ['id' => DBA::lastInsertId()]); if (!DBA::isResult($contact)) { @@ -191,6 +192,7 @@ class Contact */ public static function update(array $fields, array $condition, $old_fields = []) { + $fields = DI::dbaDefinition()->truncateFieldsForTable('contact', $fields); $ret = DBA::update('contact', $fields, $condition, $old_fields); // Apply changes to the "user-contact" table on dedicated fields -- 2.39.5