Skip to content

Commit 99c1838

Browse files
authored
Merge pull request #50327 from nextcloud/backport/50083/stable30
[stable30] fix: Trim tags on adding or editing
2 parents 29533a6 + bc7ce1c commit 99c1838

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/private/SystemTag/SystemTagManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public function getTag(string $tagName, bool $userVisible, bool $userAssignable)
157157
* {@inheritdoc}
158158
*/
159159
public function createTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag {
160+
$tagName = trim($tagName);
160161
// Length of name column is 64
161162
$truncatedTagName = substr($tagName, 0, 64);
162163
$query = $this->connection->getQueryBuilder();
@@ -212,6 +213,7 @@ public function updateTag(
212213

213214
$beforeUpdate = array_shift($tags);
214215
// Length of name column is 64
216+
$newName = trim($newName);
215217
$truncatedNewName = substr($newName, 0, 64);
216218
$afterUpdate = new SystemTag(
217219
$tagId,

0 commit comments

Comments
 (0)