Skip to content

Commit cddcbd1

Browse files
authored
Merge pull request #50083 from nextcloud/bugfix/trim-tags
fix: Trim tags on adding or editing
2 parents fe4f40d + faa7cb7 commit cddcbd1

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)