From 0256de2e98d9f5fb8112b69c11d00445e195e374 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 28 Sep 2014 17:14:04 +0200 Subject: [PATCH] Fixed issues with tag case sensitivity --- src/Dao/TagDao.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Dao/TagDao.php b/src/Dao/TagDao.php index 679c076f..8bfa721c 100644 --- a/src/Dao/TagDao.php +++ b/src/Dao/TagDao.php @@ -34,13 +34,13 @@ class TagDao extends AbstractDao implements ICrudDao return; $tagNamesNotToCreate = array_map( - function($arrayEntity) + function ($tag) { - return $arrayEntity['name']; + return $tag->getName(); }, - iterator_to_array($this->fpdo->from('tags')->where('name', $tagNames))); + $this->findByNames($tagNames)); - $tagNamesToCreate = array_diff($tagNames, $tagNamesNotToCreate); + $tagNamesToCreate = array_udiff($tagNames, $tagNamesNotToCreate, 'strcasecmp'); foreach ($tagNamesToCreate as $tagName) {