From 365f84b6787f08c446902e643d783e4a2006ea52 Mon Sep 17 00:00:00 2001 From: mbressy Date: Thu, 7 May 2026 08:56:24 +0000 Subject: [PATCH 1/2] add reformat() method --- inc/userinjection.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/inc/userinjection.class.php b/inc/userinjection.class.php index 9928e2d9..5d69c1e2 100644 --- a/inc/userinjection.class.php +++ b/inc/userinjection.class.php @@ -169,6 +169,21 @@ public function addSpecificNeededFields($primary_type, $values) return $fields; } + /** + * @param array $values + * + * @return void + */ + public function reformat(&$values) + { + // Avoid re-encrypting already encrypted tokens during user updates. + $tokens = ['password_forget_token', 'personal_token', 'api_token', 'cookie_token']; + foreach ($tokens as $token) { + if (isset($values['User'][$token])) { + unset($values['User'][$token]); + } + } + } /** * @param array $values From 534e19def38892f24feb03ca1a85ec7509de0767 Mon Sep 17 00:00:00 2001 From: mbressy Date: Thu, 7 May 2026 09:08:22 +0000 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53938e3a..d534671e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fix retrieval of dropdown and multiline values containing special characters +- Fix repeated User updates failing with `Data too long for column cookie_token` by excluding token fields from update payloads (backport of PR #566 from GLPI 11-compatible line) ## [2.14.4] - 2025-11-25