The Spoofchecker class
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.
Intro
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
Predefined Constants
Spoofchecker::SINGLE_SCRIPT_CONFUSABLEintSpoofchecker::MIXED_SCRIPT_CONFUSABLEintSpoofchecker::WHOLE_SCRIPT_CONFUSABLEintSpoofchecker::ANY_CASEintSpoofchecker::SINGLE_SCRIPTintSpoofchecker::INVISIBLEintSpoofchecker::CHAR_LIMITintSpoofchecker::ASCIIintSpoofchecker::HIGHLY_RESTRICTIVEintSpoofchecker::MODERATELY_RESTRICTIVEintSpoofchecker::MINIMALLY_RESTRICTIVEintSpoofchecker::UNRESTRICTIVEintSpoofchecker::SINGLE_SCRIPT_RESTRICTIVEintSpoofchecker::MIXED_NUMBERSintSpoofchecker::HIDDEN_OVERLAYintSpoofchecker::IGNORE_SPACEintSpoofchecker::CASE_INSENSITIVEintEnables case-insensitive matching
Spoofchecker::ADD_CASE_MAPPINGSintAdds all case mappings for each element in the set
Spoofchecker::SIMPLE_CASE_INSENSITIVEintEnables case-insensitive matching
Changelog
| Version | Description |
|---|---|
| 8.4.0 | Added Spoofchecker::IGNORE_SPACE, Spoofchecker::CASE_INSENSITIVE, Spoofchecker::ADD_CASE_MAPPINGS, Spoofchecker::SIMPLE_CASE_INSENSITIVE. |
| 8.4.0 | The class constants are now typed. |
| 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. |
Spoofchecker