2017 © Pedro Peláez
 

library escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

image

phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  • Friday, July 24, 2015
  • by pedrobrazao
  • Repository
  • 2 Watchers
  • 4 Stars
  • 77 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Phower Escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context., (*1)

Phower\Escaper is inspired in Zend's escaper component and both attempt to minimize the risks from the second most important OWASP web security risk., (*2)

Instalation

This package uses Composer tool for auto-loading and dependency management. From your project root folder just run:, (*3)

composer require phower/escaper

Usage

Simply instantiate your object as usual:, (*4)

``` php
use Phower\Escaper;

$escaper = new Escaper();
```

Class constructor supports a argument which allows to specify a given encoding format. E.g you can escape code from iso-8859-1 using:, (*5)

``` php
use Phower\Escaper;

$escaper = new Escaper('iso-8859-1');
```

This package is meant to be used for code output escaping only. Looking the implemented interface there are five methods available for that:, (*6)

  • escapeHtml: escape a string for the HTML Body context.
  • escapeHtmlAttr: escape a string for the HTML Attribute context.
  • escapeJs: escape a string for the Javascript context.
  • escapeCss: escape a string for the CSS context.
  • escapeUrl: escape a string for the URI or Parameter contexts.

The Versions

24/07 2015

dev-master

9999999-dev https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira

24/07 2015

0.2.3

0.2.3.0 https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira

24/07 2015

0.2.2

0.2.2.0 https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira

23/07 2015

0.2.1

0.2.1.0 https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira

23/07 2015

0.2.0

0.2.0.0 https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira

23/07 2015

0.1.0

0.1.0.0 https://github.com/phower/escaper

A PHP class which offers a way to escape output and defend from XSS and related vulnerabilities by introducing HTML, CSS and Javascript escaping context.

  Sources   Download

MIT

The Requires

  • php ^5.4

 

The Development Requires

by Pedro Brazao Ferreira