Skip to content

Commit 1d781fb

Browse files
committed
With ICU 58+, set the default restriction level to high
Further experiments show, that CJK scripts should be ok. If there are any issues, the moderate level can still be set later.
1 parent 44b3bc8 commit 1d781fb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

ext/intl/spoofchecker/spoofchecker_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
7878
RETURN_FALSE; \
7979
} \
8080

81-
#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_MODERATELY_RESTRICTIVE
81+
#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_HIGHLY_RESTRICTIVE
8282

8383
#endif // #ifndef SPOOFCHECKER_CLASS_H

ext/intl/spoofchecker/spoofchecker_create.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ PHP_METHOD(Spoofchecker, __construct)
4848
/* ICU 58 removes WSC and MSC handling. However there are restriction
4949
levels as defined in
5050
http://www.unicode.org/reports/tr39/tr39-15.html#Restriction_Level_Detection
51-
and the default is high restrictive. However the moderately restrictive
52-
level is what seems to correspond to the setting below applicable to
53-
ICU < 58. In further, we might want to utilize uspoof_check2 APIs when
54-
it became stable, to use extended check result APIs. Subsequent changes
55-
in the unicode security algos are to be watched.*/
51+
and the default is high restrictive. In further, we might want to utilize
52+
uspoof_check2 APIs when it became stable, to use extended check result APIs.
53+
Subsequent changes in the unicode security algos are to be watched.*/
5654
uspoof_setRestrictionLevel(co->uspoof, SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL);
5755
#else
5856
/* Single-script enforcement is on by default. This fails for languages

0 commit comments

Comments
 (0)