From f414551c6d22fd406c6a1272471c07a936647181 Mon Sep 17 00:00:00 2001 From: Kostiantyn Miakshyn Date: Wed, 8 Jan 2025 00:47:04 +0100 Subject: [PATCH] fix: Trim tags on adding or editing Signed-off-by: Kostiantyn Miakshyn --- lib/private/SystemTag/SystemTagManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index 4f05d40c34c10..8bbd36c384fcf 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -145,6 +145,7 @@ public function getTag(string $tagName, bool $userVisible, bool $userAssignable) } public function createTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag { + $tagName = trim($tagName); // Length of name column is 64 $truncatedTagName = substr($tagName, 0, 64); $query = $this->connection->getQueryBuilder(); @@ -199,6 +200,7 @@ public function updateTag( $beforeUpdate = array_shift($tags); // Length of name column is 64 + $newName = trim($newName); $truncatedNewName = substr($newName, 0, 64); $afterUpdate = new SystemTag( $tagId,