Fixed issues with tag case sensitivity

This commit is contained in:
Marcin Kurczewski 2014-09-28 17:14:04 +02:00
parent 50ca13b136
commit 0256de2e98

View file

@ -34,13 +34,13 @@ class TagDao extends AbstractDao implements ICrudDao
return; return;
$tagNamesNotToCreate = array_map( $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) foreach ($tagNamesToCreate as $tagName)
{ {