Example #1
0
 /**
  * This returns the value of the given key passed through the HTMLPurifer
  * object, if it is instantiated with Cage::loadHTMLPurifer
  *
  * @param string $key
  * @return mixed purified HTML version of input
  * @throws Exception
  * @tag filter
  */
 public function getPurifiedHTML($key)
 {
     if (!isset($this->purifier)) {
         throw new Exception("HTMLPurifier was not loaded");
     }
     $val = $this->getValue($key);
     if (Inspekt::isArrayOrArrayObject($val)) {
         return $this->purifier->purifyArray($val);
     } else {
         return $this->purifier->purify($val);
     }
 }
 /**
  * This returns the value of the given key passed through the HTMLPurifer
  * object, if it is instantiated with Inspekt_Cage::loadHTMLPurifer
  *
  * @param string $key
  * @return mixed purified HTML version of input
  * @tag filter
  */
 function getPurifiedHTML($key)
 {
     if (!isset($this->purifier)) {
         trigger_error("HTMLPurifier was not loaded", E_USER_WARNING);
         return false;
     }
     if (!$this->keyExists($key)) {
         return false;
     }
     $val = $this->_getValue($key);
     if (Inspekt::isArrayOrArrayObject($val)) {
         return $this->purifier->purifyArray($val);
     } else {
         return $this->purifier->purify($val);
     }
 }