La classe Spoofchecker

(PHP 5 >= 5.4.0, PHP 7, PHP 8, PECL intl >= 2.0.0)

Introduction

Cette classe est fournie car Unicode contient un grand nombre de caractères et incorpore les systèmes d'écriture variés du monde et leur utilisation incorrecte peut exposer des programmes ou des systèmes à d'éventuelles attaques de sécurité en utilisant la similarité des caractères.

Les méthodes fournies permettent de vérifier si une chaîne individuelle est susceptible d'être une tentative à tromper le lecteur (détection de tromperie), tel que dans "pаypаl" orthographié avec un caractère 'а' cyrillique.

Synopsis de la classe

class Spoofchecker {
/* Constants */
const int|float ASCII = 0x10000000;
const int|float HIGHLY_RESTRICTIVE = 0x30000000;
const int|float MODERATELY_RESTRICTIVE = 0x40000000;
const int|float MINIMALLY_RESTRICTIVE = 0x50000000;
const int|float UNRESTRICTIVE = 0x60000000;
const int|float SINGLE_SCRIPT_RESTRICTIVE = 0x20000000;
const int ANY_CASE = 8;
const int SINGLE_SCRIPT = 16;
const int INVISIBLE = 32;
const int CHAR_LIMIT = 64;
/* Méthodes */
public __construct()
public areConfusable(string $string1, string $string2, int &$errorCode = null): bool
public isSuspicious(string $string, int &$errorCode = null): bool
public setAllowedLocales(string $locales): void
public setChecks(int $checks): void
}

Constantes pré-définies

Spoofchecker::ASCII

Spoofchecker::HIGHLY_RESTRICTIVE

Spoofchecker::MODERATELY_RESTRICTIVE

Spoofchecker::MINIMALLY_RESTRICTIVE

Spoofchecker::UNRESTRICTIVE

Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE

Spoofchecker::SINGLE_SCRIPT_CONFUSABLE

Spoofchecker::MIXED_SCRIPT_CONFUSABLE

Spoofchecker::WHOLE_SCRIPT_CONFUSABLE

Spoofchecker::ANY_CASE

Spoofchecker::SINGLE_SCRIPT

Spoofchecker::INVISIBLE

Spoofchecker::CHAR_LIMIT

Historique

Version Description
7.3.0 Les constantes de classe utilisé par Spoofchecker::setRestrictionLevel() tel que Spoofchecker::ASCII, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, Spoofchecker::UNRESTRICTIVE, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE ont été ajoutées.

Sommaire