Skip to content

Commit

Permalink
fix: Trim tags on adding or editing
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Miakshyn <[email protected]>
  • Loading branch information
Koc committed Jan 13, 2025
1 parent 9c717aa commit 7f35000
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/private/SystemTag/SystemTagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7f35000

Please sign in to comment.