Skip to content

Firefly III: a personal finances manager

Fix #1979

James Colefa4959fc6af4
diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php
index 142b503612..50bc3ee548 100644
--- a/app/Factory/TagFactory.php
+++ b/app/Factory/TagFactory.php
@@ -63,7 +63,7 @@ class TagFactory
return Tag::create(
[
'user_id' => $this->user->id,
- 'tag' => $data['tag'],
+ 'tag' => trim($data['tag']),
'tagMode' => 'nothing',
'date' => $data['date'],
'description' => $data['description'],
@@ -81,6 +81,7 @@ class TagFactory
*/
public function findOrCreate(string $tag): ?Tag
{
+ $tag = trim($tag);
if (null === $this->tags) {
$this->tags = $this->user->tags()->get();
}