leafs / anchor
Leaf PHP util module
Fund package maintenance!
Open Collective
leafsphp
Installs: 28 482
Dependents: 10
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires (Dev)
- pestphp/pest: ^1.21
README
Leaf Anchor
This package contains leaf's utils for deep sanitizing of data and basic security provided for your app data. It also serves as the base for security provided in other modules like CSRF.
Installation
You can easily install Leaf using Composer.
composer require leafs/anchor
Basic Usage
After installing anchor, create an index.php file.
Base XSS protection
<?php require __DIR__ . "vendor/autoload.php"; $data = $_POST["data"]; $data = Leaf\Anchor::sanitize($data); echo $data;
This also works on arrays
<?php require __DIR__ . "vendor/autoload.php"; $data = Leaf\Anchor::sanitize($_POST); echo $data["input"];
You may quickly test this using the built-in PHP server:
php -S localhost:8000