2017 © Pedro Peláez
 

library anti-xss-twig

Twig extension for XSS protection.

image

voku/anti-xss-twig

Twig extension for XSS protection.

  • Saturday, December 23, 2017
  • by voku
  • Repository
  • 1 Watchers
  • 8 Stars
  • 2,979 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

Build Status Coverage Status Scrutinizer Code Quality Codacy Badge SensioLabsInsightLatest Stable Version Total Downloads Latest Unstable Version License, (*1)

AntiXSS for Twig

Description

A Twig extension for voku/anti-xss., (*2)

Currently supported Twig features are:, (*3)

  • Tag (recommended)
    • {% xss_clean %} <foo>bar</foo> {% end_xss_clean %}
  • Function
    • {{ xss_clean(' <foo>bar</foo>') }}
  • Filter, (*4)

    • {{ '<foo>bar</foo>' | xss_clean }}
  • Installation, (*5)

  • Usage
  • History

Installation

  1. Install and use composer in your project.
  2. Require this package via composer:
composer require voku/anti-xss-twig

Usage

First register the extension with Twig:, (*6)

use voku\helper\AntiXSS;
use voku\twig\AntiXssExtension;

$twig = new Twig_Environment($loader);
$antiXss = new AntiXSS();
$twig->addExtension(new AntiXssExtension($antiXss));

Then use it in your templates:, (*7)

{% xss_clean %} <foo>bar</foo> {% end_xss_clean %}
$twig->addExtension(new AntiXssExtension($antiXss));

History

See CHANGELOG for the full history of changes., (*8)

The Versions

23/12 2017

dev-master

9999999-dev

Twig extension for XSS protection.

  Sources   Download

MIT

The Requires

 

The Development Requires

twig extension security html xss

23/12 2017

3.0.0

3.0.0.0

Twig extension for XSS protection.

  Sources   Download

MIT

The Requires

 

The Development Requires

twig extension security html xss

03/12 2017

2.0.1

2.0.1.0

Twig extension for XSS protection.

  Sources   Download

MIT

The Requires

 

The Development Requires

twig extension security html xss

19/11 2017

2.0.0

2.0.0.0

Twig extension for XSS protection.

  Sources   Download

MIT

The Requires

 

The Development Requires

twig extension security html xss

22/03 2017

1.0.0

1.0.0.0

Twig extension for XSS protection.

  Sources   Download

MIT

The Requires

 

The Development Requires

twig extension security html xss