Documentation

SpoofDetector
in package

Class SpoofDetector

Table of Contents

Methods

checkReservedName()  : bool
Checks whether a name is a homograph for a reserved name.
checkSimilarGroupName()  : bool
Checks whether a name is a homograph for an existing membergroup name.
checkSimilarMemberName()  : bool
Checks whether a name is a homograph for another existing member name.
enhanceWordCensor()  : void
Prevent spoof characters from bypassing the word censor.
getSkeletonString()  : string
Get the "skeleton" of a string.
resolveScriptSet()  : array<string|int, mixed>
Get the resolved script set of a string.
checkHomographNames()  : bool
Checks whether $name is confusable with any string in $homograph_names.

Methods

checkReservedName()

Checks whether a name is a homograph for a reserved name.

public static checkReservedName(string $name[, bool $fatal = false ]) : bool
Parameters
$name : string

The name to check.

$fatal : bool = false

If true, die with a fatal error if a match is found. Default: false.

Return values
bool

Whether $name is a homograph for a reserved name.

checkSimilarGroupName()

Checks whether a name is a homograph for an existing membergroup name.

public static checkSimilarGroupName(string $name[, bool $fatal = false ]) : bool
Parameters
$name : string

The name to check.

$fatal : bool = false

If true, die with a fatal error if a match is found. Default: false.

Return values
bool

Whether $name is a homograph for a membergroup name.

checkSimilarMemberName()

Checks whether a name is a homograph for another existing member name.

public static checkSimilarMemberName(string $name[, int $id_member = 0 ][, bool $fatal = false ]) : bool
Parameters
$name : string

The name to check.

$id_member : int = 0

ID of the member whose name this is.

$fatal : bool = false

If true, die with a fatal error if a match is found. Default: false.

Return values
bool

Whether $name is a homograph for an existing member name.

enhanceWordCensor()

Prevent spoof characters from bypassing the word censor.

public static enhanceWordCensor(string $text) : void
Parameters
$text : string

The string being censored.

getSkeletonString()

Get the "skeleton" of a string.

public static getSkeletonString(string $string) : string

See https://www.unicode.org/reports/tr39/#Confusable_Detection

Parameters
$string : string

The string

Return values
string

The skeleton string.

resolveScriptSet()

Get the resolved script set of a string.

public static resolveScriptSet(string $string) : array<string|int, mixed>

See http://www.unicode.org/reports/tr39/#Confusable_Detection

Parameters
$string : string

The string to analyze.

Return values
array<string|int, mixed>

The resolved script set for $string.

checkHomographNames()

Checks whether $name is confusable with any string in $homograph_names.

protected static checkHomographNames(string $name, array<string|int, mixed> $homograph_names[, bool $fatal = false ]) : bool
Parameters
$name : string

The name to check.

$homograph_names : array<string|int, mixed>

Possibly similar names.

$fatal : bool = false

If true, die with a fatal error on a match. Default: false.

Return values
bool

Whether $name matched any string in $homograph_names.


        
On this page

Search results