protected function _prepareMetaDescription($meta, $length = 1024, $removeDuplicatedWords = false)
    {
        if ($meta) {
            $stringModifier = getStr();
            if ($length != -1) {
                /* *
                 * performance - we do not need a huge amount of initial text.
                 * assume that effective text may be double longer than $length
                 * and simple truncate it
                 */
                $doubleLength = ($length * 2);
                $meta = $stringModifier->substr($meta, 0, $doubleLength);
            }

            // decoding html entities
            $meta = $stringModifier->html_entity_decode($meta);
            // stripping HTML tags
            $meta = $stringModifier->strip_tags($meta);

            // removing some special chars
            $meta = $stringModifier->cleanStr($meta);

            // removing duplicate words
            if ($removeDuplicatedWords) {
                $meta = $this->_removeDuplicatedWords($meta, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSkipTags'));
            }

            // some special cases
            $meta = str_replace(' ,', ',', $meta);
            $pattern = ["/,[\s\+\-\*]*,/", "/\s+,/"];
            $meta = $stringModifier->preg_replace($pattern, ',', $meta);
            $meta = \OxidEsales\Eshop\Core\Registry::getUtilsString()->minimizeTruncateString($meta, $length);
            $meta = $stringModifier->htmlspecialchars($meta);

            return trim($meta);
        }
    }