[-] BO : fix #PSCFV-3207 && normalize

This commit is contained in:
lLefevre
2012-07-23 15:06:06 +00:00
parent 9e8546946b
commit e5053ed412
2 changed files with 49 additions and 42 deletions
+2 -2
View File
@@ -92,13 +92,13 @@ class TagCore extends ObjectModel
* @param string|array $tag_list List of tags, as array or as a string with comas
* @return boolean Operation success
*/
public static function addTags($id_lang, $id_product, $tag_list)
public static function addTags($id_lang, $id_product, $tag_list, $separator = ',')
{
if (!Validate::isUnsignedId($id_lang))
return false;
if (!is_array($tag_list))
$tag_list = array_unique(array_map('trim', preg_split('/,/', $tag_list, null, PREG_SPLIT_NO_EMPTY)));
$tag_list = array_unique(array_map('trim', preg_split('#\\'.$separator.'#', $tag_list, null, PREG_SPLIT_NO_EMPTY)));
$list = array();
foreach ($tag_list as $tag)