This commit is contained in:
James Cole
2018-08-17 05:54:29 +02:00
parent 3ca3ce0726
commit 219a0cd612
4 changed files with 17 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ class TagList implements BinderInterface
{
if (auth()->check()) {
$list = array_unique(array_map('\strtolower', explode(',', $value)));
Log::debug('List of tags is', $list);
if (0 === \count($list)) {
Log::error('Tag list is empty.');
throw new NotFoundHttpException; // @codeCoverageIgnore
@@ -56,7 +57,14 @@ class TagList implements BinderInterface
$collection = $allTags->filter(
function (Tag $tag) use ($list) {
return \in_array(strtolower($tag->tag), $list, true);
if(\in_array(strtolower($tag->tag), $list, true)) {
return true;
}
if(\in_array((string)$tag->id, $list, true)) {
return true;
}
return false;
}
);