Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FcPhp Security Input

Package to clean input content

Build Status codecov

PHP Version Packagist Version Total Downloads

How to install

Composer:

$ composer require 00f100/fcphp-sinput

or add in composer.json

{
    "require": {
        "00f100/fcphp-sinput": "*"
    }
}

How to use

<?php

use FcPhp\SInput\SInput;
use FcPhp\SInput\Rules\AddSlashes;
use FcPhp\SInput\Rules\HtmlEntities;
use FcPhp\SInput\Rules\StripTags;

$instance = new SInput();

$instance->addRule('addslashes', new AddSlashes());
$instance->addRule('htmlentities', new HtmlEntities());
$instance->addRule('striptags', new StripTags());

$content = [
    'con"ntent' => 'value"',
    "ch'~ve" => "value'2",
    'tag' => '<tag>content</tag>',
];
$this->instance->executeRules(['striptags', 'htmlentities', 'addslashes'], $content);

//  Print:
//  
//  Array(
//      'con&quot;ntent' => 'value&quot;',
//      'ch\\\'~ve' => 'value\\\'2',
//      'tag' => 'content'
//  )
//
echo $content;

About

Package to clean input content

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages