Example #1
0
 /**
  * Set the value of a var
  * 
  * @param str   	the var name, or array of vars
  * @param str|bol  	the var value, or apply the xss_clean filter
  * @param bol   	apply the xss_clean filter
  */
 public function assign($first, $second = FALSE, $third = FALSE)
 {
     if (is_array($first)) {
         if ($second) {
             $first = array_map_recursive('xss_safe', $first);
         }
         $this->vars = $first + $this->vars;
     } else {
         if ($third) {
             $second = xss_safe($second);
         }
         $this->vars[$first] = $second;
     }
 }
Example #2
0
/**
 * This one replaces NewLines with <br/>
 * @see echo
 * @param unknown $data
 */
function echo_br($data)
{
    echo nl2br(xss_safe($data));
}
Example #3
0
 function safe_echo($data)
 {
     echo xss_safe($data);
 }