From: Michael J. Rubinsky Date: Thu, 29 Jan 2009 22:34:52 +0000 (-0500) Subject: Correctly deal with sql case insensitivity. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=02e85eac62ebef1a704bf89180c24d2b61cc6a46;p=horde.git Correctly deal with sql case insensitivity. --- diff --git a/content/lib/Tagger.php b/content/lib/Tagger.php index cef7606ff..973b9b298 100644 --- a/content/lib/Tagger.php +++ b/content/lib/Tagger.php @@ -642,8 +642,13 @@ class Content_Tagger // Get the ids for any tags that already exist. if (count($tagText)) { foreach ($this->_db->selectAll('SELECT tag_id, tag_name FROM ' . $this->_t('tags') . ' WHERE tag_name IN ('.implode(',', array_map(array($this->_db, 'quote'), array_keys($tagText))).')') as $row) { - $tagIndex = $tagText[$row['tag_name']]; - unset($tagText[$row['tag_name']]); + $tagTextCopy = $tagText; + foreach ($tagTextCopy as $tag => $tagIndex) { + if (strtolower($row['tag_name']) == strtolower($tag)) { + unset($tagText[$tag]); + break; + } + } $tagIds[$tagIndex] = $row['tag_id']; } }