This commit is contained in:
Kekskurse 2021-02-08 11:03:14 +01:00
parent a40a9a523e
commit 6230f7e836

View file

@ -32,10 +32,15 @@ class Gallery extends JsonResource
]]; ]];
$data["description"] = $this->description; $data["description"] = $this->description;
$t = json_decode($this->tags); $t = json_decode($this->tags);
if(is_array($t)) {
foreach ($t as $i => $g) { foreach ($t as $i => $g) {
$t[$i] = trim($g); $t[$i] = trim($g);
} }
$data["tags"] = $t; $data["tags"] = $t;
} else {
$data["tags"] = null;
}
return $data; return $data;
} }
} }