PHP Класс Microweber\Utils\lib\XSSSecurity

Some code in this class it taken from CodeIgniter 3. See the original here: http://bit.ly/1oQnpjn.
Автор: Andrey Andreev ([email protected])
Автор: Derek Jones ([email protected])
Автор: Graham Campbell ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$evil string[] The evil attributes.
$xssHash string A random hash for protecting urls.

Открытые методы

Метод Описание
__construct ( array $evil = null ) Create a new security instance.
clean ( string | string[] $str ) : string XSS clean.

Защищенные методы

Метод Описание
compactExplodedWords ( array $matches ) : string Compact exploded words.
convertAttribute ( array $match ) : string Attribute conversion.
decodeEntity ( array $match ) : string HTML entity decode callback.
doNeverAllowed ( string $str ) : string Do never allowed.
entityDecode ( string $str ) : string HTML entities decode.
filterAttributes ( string $str ) : string Attribute filtering.
jsImgRemoval ( array $match ) : string JS image removal.
jsLinkRemoval ( array $match ) : string JS link removal.
process ( string $str ) : string Process a string for cleaning.
removeEvilAttributes ( string $str ) : string Remove evil html attributes.
removeInvisibleCharacters ( string $str, boolean $urlEncoded = true ) : string Removes invisible characters.
sanitizeNaughtyHtml ( array $matches ) : string Sanitize naughty html.
xssHash ( ) : string Generates the XSS hash if needed and returns it.

Описание методов

__construct() публичный Метод

Create a new security instance.
public __construct ( array $evil = null )
$evil array

clean() публичный Метод

XSS clean.
public clean ( string | string[] $str ) : string
$str string | string[]
Результат string

compactExplodedWords() защищенный Метод

Compact exploded words.
protected compactExplodedWords ( array $matches ) : string
$matches array
Результат string

convertAttribute() защищенный Метод

Attribute conversion.
protected convertAttribute ( array $match ) : string
$match array
Результат string

decodeEntity() защищенный Метод

HTML entity decode callback.
protected decodeEntity ( array $match ) : string
$match array
Результат string

doNeverAllowed() защищенный Метод

Do never allowed.
protected doNeverAllowed ( string $str ) : string
$str string
Результат string

entityDecode() защищенный Метод

HTML entities decode.
protected entityDecode ( string $str ) : string
$str string
Результат string

filterAttributes() защищенный Метод

Attribute filtering.
protected filterAttributes ( string $str ) : string
$str string
Результат string

jsImgRemoval() защищенный Метод

JS image removal.
protected jsImgRemoval ( array $match ) : string
$match array
Результат string

jsLinkRemoval() защищенный Метод

JS link removal.
protected jsLinkRemoval ( array $match ) : string
$match array
Результат string

process() защищенный Метод

Process a string for cleaning.
protected process ( string $str ) : string
$str string
Результат string

removeEvilAttributes() защищенный Метод

Remove evil html attributes.
protected removeEvilAttributes ( string $str ) : string
$str string
Результат string

removeInvisibleCharacters() защищенный Метод

Removes invisible characters.
protected removeInvisibleCharacters ( string $str, boolean $urlEncoded = true ) : string
$str string
$urlEncoded boolean
Результат string

sanitizeNaughtyHtml() защищенный Метод

Sanitize naughty html.
protected sanitizeNaughtyHtml ( array $matches ) : string
$matches array
Результат string

xssHash() защищенный Метод

Generates the XSS hash if needed and returns it.
protected xssHash ( ) : string
Результат string

Описание свойств

$evil защищенное свойство

The evil attributes.
protected string[] $evil
Результат string[]

$xssHash защищенное свойство

A random hash for protecting urls.
protected string $xssHash
Результат string