diff --git a/src/Dao/TagDao.php b/src/Dao/TagDao.php index 4fe18c21..12824575 100644 --- a/src/Dao/TagDao.php +++ b/src/Dao/TagDao.php @@ -60,8 +60,14 @@ class TagDao extends AbstractDao implements ICrudDao ->where('pt2.tagId', $tagId) ->groupBy('tags.id') ->orderBy('postCount DESC, name ASC'); - $arrayEntities = iterator_to_array($query); - array_shift($arrayEntities); //don't show input tag itself + + $arrayEntities = array_filter( + iterator_to_array($query), + function($arrayEntity) use ($tagName) + { + return strcasecmp($arrayEntity['name'], $tagName) !== 0; + }); + return $this->arrayToEntities($arrayEntities); } diff --git a/src/Services/TagService.php b/src/Services/TagService.php index 5514095a..c1b7b4a3 100644 --- a/src/Services/TagService.php +++ b/src/Services/TagService.php @@ -192,13 +192,13 @@ class TagService private function updateImplications(Tag $tag, array $relatedNames) { - $relatedNames = array_udiff($relatedNames, [$tag->getName()], 'strnatcasecmp'); + $relatedNames = array_udiff($relatedNames, [$tag->getName()], 'strcasecmp'); $tag->setImpliedTags($this->createTags($relatedNames)); } private function updateSuggestions(Tag $tag, array $relatedNames) { - $relatedNames = array_udiff($relatedNames, [$tag->getName()], 'strnatcasecmp'); + $relatedNames = array_udiff($relatedNames, [$tag->getName()], 'strcasecmp'); $tag->setSuggestedTags($this->createTags($relatedNames)); } }