Documentation

XmlScanner
in package

Table of Contents

Constants

ENCODING_PATTERN  = '/encoding\s*=\s*(["\'])(.+?)\1/s'
ENCODING_UTF7  = '/encoding\s*=\s*(["\'])UTF-7\1/si'

Properties

$callback  : callable|null
$pattern  : string

Methods

__construct()  : mixed
getInstance()  : self
scan()  : string
Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.
scanFile()  : string
Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.
setAdditionalCallback()  : void
findCharSet()  : string
forceString()  : string
toUtf8()  : string

Constants

ENCODING_PATTERN

private mixed ENCODING_PATTERN = '/encoding\s*=\s*(["\'])(.+?)\1/s'

ENCODING_UTF7

private mixed ENCODING_UTF7 = '/encoding\s*=\s*(["\'])UTF-7\1/si'

Properties

Methods

__construct()

public __construct([string $pattern = '<!DOCTYPE' ]) : mixed
Parameters
$pattern : string = '<!DOCTYPE'

scan()

Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.

public scan(false|string $xml) : string
Parameters
$xml : false|string
Return values
string

scanFile()

Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.

public scanFile(string $filestream) : string
Parameters
$filestream : string
Return values
string

setAdditionalCallback()

public setAdditionalCallback(callable $callback) : void
Parameters
$callback : callable

findCharSet()

private findCharSet(string $xml) : string
Parameters
$xml : string
Return values
string

forceString()

private static forceString(mixed $arg) : string
Parameters
$arg : mixed
Return values
string

toUtf8()

private toUtf8(string $xml) : string
Parameters
$xml : string
Return values
string

        
On this page

Search results