public function xss($data)
{
if (is_array($data)) {
$escaped = array();
foreach ($data as $key => $value) {
$escaped[$key] = $this->xss($value);
}
return $escaped;
}
return htmlspecialchars($data, ENT_QUOTES);
}