XmlScanner
in package
Table of Contents
Constants
- ENCODING_PATTERN = '/encoding\s*=\s*(["\'])(.+?)\1/s'
- ENCODING_UTF7 = '/encoding\s*=\s*(["\'])UTF-7\1/si'
Properties
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
$callback
private
callable|null
$callback
$pattern
private
string
$pattern
Methods
__construct()
public
__construct([string $pattern = '<!DOCTYPE' ]) : mixed
Parameters
- $pattern : string = '<!DOCTYPE'
getInstance()
public
static getInstance(IReader $reader) : self
Parameters
- $reader : IReader
Return values
selfscan()
Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.
public
scan(false|string $xml) : string
Parameters
- $xml : false|string
Return values
stringscanFile()
Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.
public
scanFile(string $filestream) : string
Parameters
- $filestream : string
Return values
stringsetAdditionalCallback()
public
setAdditionalCallback(callable $callback) : void
Parameters
- $callback : callable
findCharSet()
private
findCharSet(string $xml) : string
Parameters
- $xml : string
Return values
stringforceString()
private
static forceString(mixed $arg) : string
Parameters
- $arg : mixed
Return values
stringtoUtf8()
private
toUtf8(string $xml) : string
Parameters
- $xml : string