Documentation

XmlScanner

Table of Contents

$callback  : callable|null
$libxmlDisableEntityLoaderValue  : bool|null
$pattern  : string
String used to identify risky xml elements.
$shutdownRegistered  : bool
__construct()  : mixed
__destruct()  : mixed
getInstance()  : self
scan()  : string
Scan the XML for use of <!ENTITY to prevent XXE/XEE attacks.
scanFile()  : string
Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.
setAdditionalCallback()  : void
shutdown()  : void
threadSafeLibxmlDisableEntityLoaderAvailability()  : bool
disableEntityLoaderCheck()  : void
forceString()  : string
toUtf8()  : string

Properties

$libxmlDisableEntityLoaderValue

private static bool|null $libxmlDisableEntityLoaderValue

$pattern

String used to identify risky xml elements.

private string $pattern

$shutdownRegistered

private static bool $shutdownRegistered = false

Methods

__construct()

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

__destruct()

public __destruct() : mixed
Return values
mixed

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 theXML 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
Return values
void

shutdown()

public static shutdown() : void
Tags
codeCoverageIgnore
Return values
void

threadSafeLibxmlDisableEntityLoaderAvailability()

public static threadSafeLibxmlDisableEntityLoaderAvailability() : bool
Tags
codeCoverageIgnore
Return values
bool

disableEntityLoaderCheck()

private disableEntityLoaderCheck() : void
Tags
codeCoverageIgnore
Return values
void

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

Search results