    public function addTags($tags) {
        $result = false;
        $addedTags = array();

        foreach ((array) $tags as $tagName) {
            if (empty($tagName))
                continue;
            if (!in_array($tagName, $this->getTags())) { // check for duplicate tag
                $tag = new Tags;
                $tag->tag = '#' . ltrim($tagName, '#');
                $tag->itemId = $this->getOwner()->id;
                $tag->type = get_class($this->getOwner());
                $tag->taggedBy = Yii::app()->getSuName();
                $tag->timestamp = time();
                $tag->itemName = $this->getOwner()->name;

                if ($tag->save()) {
                    $this->_tags[] = $tag->tag; // update tag cache
                    $addedTags[] = $tagName;
                    $result = true;
                } else {
                    throw new CHttpException(422, 'Failed saving tag due to errors: ' . json_encode($tag->errors));
                }
            }
        }
        if ($this->flowTriggersEnabled)
            X2Flow::trigger('RecordTagAddTrigger', array(
                'model' => $this->getOwner(),
                'tags' => $addedTags,
            ));

        return $result;
    }
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.