Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

00f100/fcphp-sinput

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

00f100/fcphp-sinput

Package to clean input content

Source
Packagist
Version
0.1.0
Version published
Maintainers
1
Created
Source

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;

FAQs

Package last updated on 14 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts