From 4152025086eba20a421790b1bdd7581ba4e0edad Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 22 Aug 2013 23:09:23 +0200 Subject: [PATCH] Fixed duplicate entry issue --- .../files/lib/system/tagging/TagEngine.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php index ff844886c1..21d56d7a1d 100644 --- a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php +++ b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php @@ -52,14 +52,14 @@ class TagEngine extends SingletonFactory { foreach ($tags as $tag) { if (empty($tag)) continue; + // enforce max length + if (StringUtil::length($tag) > TAGGING_MAX_TAG_LENGTH) { + $tag = StringUtil::substring($tag, 0, TAGGING_MAX_TAG_LENGTH); + } + // find existing tag $tagObj = Tag::getTag($tag, $languageID); if ($tagObj === null) { - // enforce max length - if (StringUtil::length($tag) > TAGGING_MAX_TAG_LENGTH) { - $tag = StringUtil::substring($tag, 0, TAGGING_MAX_TAG_LENGTH); - } - // create new tag $tagAction = new TagAction(array(), 'create', array('data' => array( 'name' => $tag, -- 2.20.1