Security_helper
Prevent XSS
function xss_clean($data) {
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
}$user_input = "<script>alert('Hacked!');</script>";
$clean_input = xss_clean($user_input);
echo $clean_input;
// Output: <script>alert('Hacked!');</script>Clean Input Data to Prevent Attacks
Secure
Secure URIs to Prevent Attacks
Secure All $_GET Parameters
$_GET ParametersSecurity_helper in Controller
Last updated
Was this helpful?