Spoofchecker クラス

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

はじめに

Unicode は非常にたくさんの文字と、 世界中の様々な表記体系を含んでいます。 そのため使い方を誤ると、 文字の類似性を利用して、 プログラムやシステムに対するセキュリティ攻撃が成立する可能性があります。 そのため、このクラスが提供されています。

このクラスのメソッドを使うと、 個別の文字列が、文字の読み手を混乱させようとしている可能性があるかをチェック(spoof detection)できます。 たとえば、キリル文字の 'а' が混じった "pаypаl" のような文字列のようなものをチェックできます。

クラス概要

classSpoofchecker {
publicconstintANY_CASE;
publicconstintSINGLE_SCRIPT;
publicconstintINVISIBLE;
publicconstintCHAR_LIMIT;
publicconstintASCII;
publicconstintUNRESTRICTIVE;
publicconstintMIXED_NUMBERS;
publicconstintHIDDEN_OVERLAY;
public__construct()
publicareConfusable(string$string1, string$string2, int&$errorCode = null): bool
publicisSuspicious(string$string, int&$errorCode = null): bool
publicsetAllowedLocales(string$locales): void
publicsetChecks(int$checks): void
}

目次

To Top