2017 © Pedro Peláez
 

library jsonp-callback-validator

JSONP callback validator.

image

willdurand/jsonp-callback-validator

JSONP callback validator.

  • Tuesday, June 20, 2017
  • by couac
  • Repository
  • 5 Watchers
  • 301 Stars
  • 15,877,895 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

JsonpCallbackValidator

GitHub Actions Total
Downloads Latest Stable
Version, (*1)

JsonpCallbackValidator allows you to validate a JSONP callback in order to prevent XSS attacks., (*2)

Usage

$validator = new \JsonpCallbackValidator();

$validator->validate("JSONP.callback");
// returns `true`

$validator->validate("(function xss(x){evil()})");
// returns `false`

Or as a static method:, (*3)

\JsonpCallbackValidator::validate("JSONP.callback");
// returns `true`

\JsonpCallbackValidator::validate("(function xss(x){evil()})");
// returns `false`

Installation

The recommended way to install JsonpCallbackValidator is through Composer:, (*4)

$ composer require willdurand/jsonp-callback-validator

Unit Tests

Setup the test suite using Composer:, (*5)

$ composer install

Run it using PHPUnit:, (*6)

$ ./vendor/bin/simple-phpunit

Contributing

See CONTRIBUTING file., (*7)

Credits

License

JsonpCallbackValidator is released under the MIT License. See the bundled LICENSE file for details., (*8)

The Versions

20/06 2017

dev-master

9999999-dev

JSONP callback validator.

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0

 

The Development Requires

20/01 2014

v1.1.0

1.1.0.0

JSONP callback validator.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

21/10 2013

v1.0.0

1.0.0.0

JSONP callback validator.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires