/** * Uses HTML_Safe to * remove dangerous tags from html string * * HTML_Safe class removes body, header * leaves only what is inside body tag, (unless body and * html are added to allowed tags) * but will also work if there is no body tag at all. * * @return object of this class */ public function safeHtml(array $aAllowedTags = array()) { $ret = $this->string; if ($this->isHtml()) { $oHS = new HtmlSafe(); if (!empty($aAllowedTags)) { $oHS->setAllowedTags($aAllowedTags); } $ret = $oHS->parse($this->string); d('after safeHtml(): ' . $ret); } return $this->handleReturn($ret); }