/** * clean method * * Load the kses vendor and clean the passed string. * If the kses vendor can't be found - use $html->clean (which should still in any event be used in the view). * * @param mixed $Model * @param string $string * @return string the cleaned string * @access public */ function clean(&$Model, $string = '') { if (!$this->checkKses($Model)) { App::import('Helper', 'Html'); $html = new HtmlHelper(); return $html->clean($string); } $string = preg_replace('/<([^a-zA-Z\\/])/', '<$1', $string); return $this->kses->Parse($string); }