Skip to content

Commit 7f35000

Browse files
committed
fix: Trim tags on adding or editing
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent 9c717aa commit 7f35000

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/private/SystemTag/SystemTagManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public function getTag(string $tagName, bool $userVisible, bool $userAssignable)
145145
}
146146

147147
public function createTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag {
148+
$tagName = trim($tagName);
148149
// Length of name column is 64
149150
$truncatedTagName = substr($tagName, 0, 64);
150151
$query = $this->connection->getQueryBuilder();
@@ -199,6 +200,7 @@ public function updateTag(
199200

200201
$beforeUpdate = array_shift($tags);
201202
// Length of name column is 64
203+
$newName = trim($newName);
202204
$truncatedNewName = substr($newName, 0, 64);
203205
$afterUpdate = new SystemTag(
204206
$tagId,

0 commit comments

Comments
 (0)