static function Instance($var = NULL) { if ($var == NULL) { if (!isset(self::$mInstance)) { self::$mInstance = new Sanitizer(NULL); } return self::$mInstance; } else { if ($var instanceof Sanitizer) { $var = $var->Raw(); } $result = new Sanitizer($var); if (Configuration::Instance()->GetValue('application', 'strip_html_tags')) { $result = $result->StripHtmlTags(); } return $result; } }