Security Core was created by, and is maintained by Graham Campbell, and is a port of the security class from CodeIgniter 3 for general use. Laravel wrappers for this package exist as Laravel Security and Laravel Binput. Feel free to check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.
Security Core requires PHP 7.0-7.4.
To get the latest version, simply require the project using Composer:
$ composer require graham-campbell/security-core
To sanitize your string, simply call the clean
method on the Security
class.
<?php
use GrahamCampbell\SecurityCore\Security;
// $clean = '<span xss=removed>X</span>';
$clean = (new Security)->clean('<span/onmouseover=confirm(1)>X</span>');
For usage in Laravel, check out Laravel Security and Laravel Binput.
If you discover a security vulnerability within this package, please send an email to Graham Campbell at graham@alt-three.com. All security vulnerabilities will be promptly addressed. You may view our full security policy here.
Security Core is licensed under The MIT License (MIT).
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.