https://github.com/00f100/fcphp-sinput
Package to clean input content
https://github.com/00f100/fcphp-sinput
clean content fcphp fcphp-sinput input security
Last synced: 2 months ago
JSON representation
Package to clean input content
- Host: GitHub
- URL: https://github.com/00f100/fcphp-sinput
- Owner: 00F100
- License: mit
- Created: 2018-08-13T23:39:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T02:33:23.000Z (almost 8 years ago)
- Last Synced: 2025-01-01T16:26:33.798Z (over 1 year ago)
- Topics: clean, content, fcphp, fcphp-sinput, input, security
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FcPhp Security Input
Package to clean input content
[](https://travis-ci.org/00F100/fcphp-sinput) [](https://codecov.io/gh/00F100/fcphp-sinput)
[](https://packagist.org/packages/00F100/fcphp-sinput) [](https://packagist.org/packages/00F100/fcphp-sinput) [](https://packagist.org/packages/00F100/fcphp-sinput)
## How to install
Composer:
```sh
$ composer require 00f100/fcphp-sinput
```
or add in composer.json
```json
{
"require": {
"00f100/fcphp-sinput": "*"
}
}
```
## How to use
```php
addRule('addslashes', new AddSlashes());
$instance->addRule('htmlentities', new HtmlEntities());
$instance->addRule('striptags', new StripTags());
$content = [
'con"ntent' => 'value"',
"ch'~ve" => "value'2",
'tag' => 'content',
];
$this->instance->executeRules(['striptags', 'htmlentities', 'addslashes'], $content);
// Print:
//
// Array(
// 'con"ntent' => 'value"',
// 'ch\\\'~ve' => 'value\\\'2',
// 'tag' => 'content'
// )
//
echo $content;
```