sanitizers / sanitizers
BK Sanitizers is a community-developed, free and open source library for sanitizing user data in PHP.
Requires
- php: >=5.3.0
- ext-filter: *
- ext-mbstring: *
- ezyang/htmlpurifier: ^4.12
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- yoast/phpunit-polyfills: ^0.2
README
This package is no longer maintained.
BK Sanitizers (BKS)
Quickly Sanitize user data
BK Sanitizers is a community-developed, free and open source library for sanitizing user data in PHP.
An acronym/abbreviation for Baal-Krshna Sanitizers is BK Sanitizers.
And an acronym/abbreviation for BK Sanitizers is BKS.
Latest release:
Explore:
BK Sanitizers Docs »
BK Sanitizers Wiki »
Report bug(s) • Releases • Request feature • Blog
Table of contents
Features
- Sanitize strings and arrays
- Namespaced to prevent name clashes
- PHP 5.3.0 support
- Examples for how-to use BK Sanitizers
- Use configuration from ini file
- Easy to Use
- And many more...
Quick Start 🚀
- Using git:
git clone https://github.com/PuneetGopinath/Sanitizers.git
- OR
- Using github cli:
gh repo clone PuneetGopinath/Sanitizers
Please read INSTALL.md file for The installation guide.
Please see docs folder.
If you are using composer, then replace require "src/BKS.auto.php";
with require "vendor/autoload.php";
<?php // Import classes use Sanitizers\Sanitizers\Sanitizer; require "src/BKS.auto.php"; // passing `true` in Sanitizer class enables exceptions $sanitizer = new Sanitizer(true); try { echo $sanitizer->sanitize("username", $_GET["username"]); } catch (Exception $e) { echo "Could not Sanitize user input."; echo $e->getMessage(); } ?>
Status
This project is currently being maintained. And Will Be Maintained. If You Like This Project And Want This Project To Never Exhaust. Please Consider Donating.
GitHub
Packagist
FAQ
Read the FAQ.md file in docs to understand the frequently asked questions to BKS:
- What is Sanitize??
- When and why should I use Sanitizers?
- And many more...
Files️
Sanitizers/
└── src/
├── Sanitizer.php
└── config.ini
└── BKS.auto.php
└── test/
└── SanitizersTest.php
└── README.md
Prerequisites 📋
See Prerequisites section in INSTALL.md.
Tests ⚙️
Run either composer run-script test
or php vendor/bin/phpunit
Contributing
Plz read CONTRIBUTING.md file.
Community 💬
Get updates on Sanitizers's development and chat with the BKS maintainers and community members.
Plz see SUPPORT.md file.
Authors ✒️
- Puneet Gopinath - GitHub - Email - Donate at patreon
See also the list of contributors who participated in building this project.
Supporters
👏 Thank you very much !
You have proved that BK Sanitizers has some value !!
Stargazers
Forks
Contributors
Thanks to all contributors again !!
LICENSE 📄
Read LICENSE file.
Comparing 😕
Are you comparing BKS library with HTMLPurifier ??
Then, you need to know difference between HTMLPurifier and BKS.
- HTMLPurifier aims at creating safe and valid HTML as close as possible to a given input. But we aim to cover sanitizing all types of input like name, username, password, etc.
But we always recomend HTMLPurifier for sanitizing html code.
Support Us
Review
Sponsor
Support BK Sanitizers by becoming a sponsor.
Your name will be added manually (by us) below Click here to sponsor
.
If your name is not added within 1 week, mail to baalkrshna@gmail.com.
Click here to sponsor:
Project sponsored by:
- No sponsors, be the first to sponsor now itself by clicking any one of the above links!
Spread
Help spread awareness about BK Sanitizers by:
Versioning
We use Semantic Versioning for our library.
Conclusion 🏁
If you sanitize user input then, you will be able to manage data properly, validate it, show it in a secure and reliable way.
It makes your web application trustworthy, so it must be one of your main goals from the beginning of your career as a web developer.
Some people also disagree with sanitizing input, they say sanitizing output is the best, if you want to sanitize output, then you can use the clean function