New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adamnbowen/sanitize

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adamnbowen/sanitize

Sanitizes arbitrary objects and arrays.

Source
Packagist
This package is abandoned and is no longer maintained.
The author recommends using true instead.
This version has been yanked by its maintainers and should not be used.
Version
0.3.0
Version published
Total downloads
274
Maintainers
2
Created
Source

Sanitize

Build Status

Sanitizes arbitrary objects and arrays, and provides an object interface for accessing the sanitized objects and arrays.

Usage

<?php
use Sanitize\Sanitize;

$sanitized = Sanitize::clean($_POST);
$sanitized->foo; // == a sanitized $_POST['foo'] OR null

Installation

Install via Composer, by first adding the following in your composer.json file:

{
    "require": {
        "adamnbowen/sanitize": "0.2.*"
    }
}

Then run php composer.phar install in your terminal to download and install Sanitize. Make sure to require the vendor/autoload.php generated by Composer, and you should be good to go.

Coding Standards

Use the following coding standards in order:

TODO

  • Test injection of objects into Sanitize
  • Test __PHP_Incomplete_Class fix

Changelog

  • Sanitize::Clean() is now Sanitize::clean()
  • Filtered has been renamed to Proxy()
  • Proxy is now iterable, so you can foreach over sanitized objects/arrays
  • !empty() is no longer called on values—Sanitized objects will retain values of false, 0, etc.

Keywords

proxy

FAQs

Package last updated on 30 Jul 2012

Related posts