Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 days 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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T02:33:23.000Z (over 6 years ago)
- Last Synced: 2024-12-08T22:18:21.426Z (29 days 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
[![Build Status](https://travis-ci.org/00F100/fcphp-sinput.svg?branch=master)](https://travis-ci.org/00F100/fcphp-sinput) [![codecov](https://codecov.io/gh/00F100/fcphp-sinput/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-sinput)
[![PHP Version](https://img.shields.io/packagist/php-v/00f100/fcphp-sinput.svg)](https://packagist.org/packages/00F100/fcphp-sinput) [![Packagist Version](https://img.shields.io/packagist/v/00f100/fcphp-sinput.svg)](https://packagist.org/packages/00F100/fcphp-sinput) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-sinput/downloads)](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;```