Made ospos XSS clean optional and configurable from application/config/config.php (#39)

Performance improves if set to FALSE but should be only for pure stand alone and isolated from Internet cases.
This commit is contained in:
FrancescoUK
2016-06-21 18:31:39 +01:00
parent 9a1def21cc
commit 04fdbfb187
2 changed files with 24 additions and 2 deletions

View File

@@ -38,7 +38,17 @@ class Secure_Controller extends CI_Controller
*/
protected function xss_clean($str, $is_image = FALSE)
{
return $this->security->xss_clean($str, $is_image);
// This setting is configurable in application/config/config.php.
// Users can disable the XSS clean for performance reasons
// (cases like intranet installation with no Internet access)
if($this->config->item('ospos_xss_clean') == FALSE)
{
return $str;
}
else
{
return $this->security->xss_clean($str, $is_image);
}
}
// this is the basic set of methods most OSPOS Controllers will implement