protected function cleanHTMLPurify($string, $allowedTags = null)
    {
        if(strlen($string)==0)
            return '';

        if($allowedTags === null)
            $allowedTags = $this->defaultAllowedTags;

        if($allowedTags == '*')
            return $string;

        if(is_null($this->purifier))
        {
            require_once PATH_SYSTEM . '/vendors/HTMLPurifier.php';

            $this->purifier = HTMLPurifier::instance();

            FileSystemUtils::recursiveMkdir($this->vendorCacheDirectory.'/purifier/');
        }


        $string = $this->purifier->purify($string, array(
                'Core.Encoding'            => $this->charset,
                'HTML.TidyLevel'           =>'none',
                'HTML.Allowed'             => $allowedTags,
                'AutoFormat.AutoParagraph' => false,
                //'HTML.Doctype'           => 'XHTML 1.0 Transitional',
                'Cache.SerializerPath'     => $this->vendorCacheDirectory.'/purifier/'
                ));

//        $string = html_entity_decode($string, ENT_COMPAT, $this->charset);

        return $string;
    }