The Spoofchecker class

Introduction

This class is provided because Unicode contains large number of characters and incorporates the varied writing systems of the world and their incorrect usage can expose programs or systems to possible security attacks using characters similarity.

Provided methods allow to check whether an individual string is likely an attempt at confusing the reader (spoof detection), such as "pаypаl" spelled with Cyrillic 'а' characters.

Class synopsis

Spoofchecker
/* Constants */
public const int Spoofchecker::SINGLE_SCRIPT_CONFUSABLE;
public const int Spoofchecker::MIXED_SCRIPT_CONFUSABLE;
public const int Spoofchecker::WHOLE_SCRIPT_CONFUSABLE;
public const int Spoofchecker::ANY_CASE;
public const int Spoofchecker::SINGLE_SCRIPT;
public const int Spoofchecker::INVISIBLE;
public const int Spoofchecker::CHAR_LIMIT;
public const int Spoofchecker::ASCII;
public const int Spoofchecker::HIGHLY_RESTRICTIVE;
public const int Spoofchecker::MODERATELY_RESTRICTIVE;
public const int Spoofchecker::MINIMALLY_RESTRICTIVE;
public const int Spoofchecker::UNRESTRICTIVE;
public const int Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE;
public const int Spoofchecker::MIXED_NUMBERS;
public const int Spoofchecker::HIDDEN_OVERLAY;
/* Methods */
public __construct()
public bool areConfusable(string $string1, string $string2, int &$errorCode = null)
public bool isSuspicious(string $string, int &$errorCode = null)
public void setAllowedLocales(string $locales)
public void setChecks(int $checks)
public void setRestrictionLevel(int $level)

Predefined Constants

Spoofchecker::SINGLE_SCRIPT_CONFUSABLE

Spoofchecker::MIXED_SCRIPT_CONFUSABLE

Spoofchecker::WHOLE_SCRIPT_CONFUSABLE

Spoofchecker::ANY_CASE

Spoofchecker::SINGLE_SCRIPT

Spoofchecker::INVISIBLE

Spoofchecker::CHAR_LIMIT

Spoofchecker::ASCII

Spoofchecker::HIGHLY_RESTRICTIVE

Spoofchecker::MODERATELY_RESTRICTIVE

Spoofchecker::MINIMALLY_RESTRICTIVE

Spoofchecker::UNRESTRICTIVE

Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE

Spoofchecker::MIXED_NUMBERS

Spoofchecker::HIDDEN_OVERLAY

Changelog

Version Description
7.3.0 Class constants used by Spoofchecker::setRestrictionLevel such as Spoofchecker::ASCII, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, Spoofchecker::UNRESTRICTIVE, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE has been added.
Table of Contents