]> granicus.if.org Git - php/commitdiff
With ICU 58+, set the default restriction level to high
authorAnatol Belski <ab@php.net>
Sat, 21 Oct 2017 15:21:41 +0000 (17:21 +0200)
committerAnatol Belski <ab@php.net>
Sat, 21 Oct 2017 15:21:41 +0000 (17:21 +0200)
Further experiments show, that CJK scripts should be ok. If there are
any issues, the moderate level can still be set later.

ext/intl/spoofchecker/spoofchecker_class.h
ext/intl/spoofchecker/spoofchecker_create.c

index 7a95f315dc5e0575488dea57818d5b0250cecc00..d6f2c2d54368364798f4411d4f105a86b74edb1c 100644 (file)
@@ -78,6 +78,6 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
         RETURN_FALSE;                                                           \
     }                                                                           \
 
-#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_MODERATELY_RESTRICTIVE
+#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_HIGHLY_RESTRICTIVE
 
 #endif // #ifndef SPOOFCHECKER_CLASS_H
index 1333a0f20502d318d516ac9f3c1f149da9cd3108..8108cafa2feb35e13544c9609879969859e5538e 100644 (file)
@@ -48,11 +48,9 @@ PHP_METHOD(Spoofchecker, __construct)
        /* ICU 58 removes WSC and MSC handling. However there are restriction
         levels as defined in
         http://www.unicode.org/reports/tr39/tr39-15.html#Restriction_Level_Detection
-        and the default is high restrictive. However the moderately restrictive
-        level is what seems to correspond to the setting below applicable to
-        ICU < 58. In further, we might want to utilize uspoof_check2 APIs when
-        it became stable, to use extended check result APIs. Subsequent changes
-        in the unicode security algos are to be watched.*/
+        and the default is high restrictive. In further, we might want to utilize
+        uspoof_check2 APIs when it became stable, to use extended check result APIs.
+        Subsequent changes in the unicode security algos are to be watched.*/
        uspoof_setRestrictionLevel(co->uspoof, SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL);
 #else
        /* Single-script enforcement is on by default. This fails for languages