-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #73655 Spoofchecker::isSuspicious behavior change due to up…
…stream changes There are significant changes in the spoof checking reflecting http://www.unicode.org/reports/tr39/tr39-15.html and relying on the restriction levels. ICU 58+ removes WSC and MSC handling and otherwise undergoes big changes in both code and data areas. Keep up with the basic points for now, as we need to move forward and provide an acceptable experience to PHP users linking to a newer ICU. The most distros ATM don't provide ICU > 57.1, though. We'll need for sure to keep up with the BC breach in ICU 58+ in possible further aspects.
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
spoofchecker suspicious character checker | ||
--SKIPIF-- | ||
<?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?> | ||
<?php if (version_compare(INTL_ICU_VERSION, '57.1') < 0) die('skip for ICU >= 58.1'); ?> | ||
--FILE-- | ||
<?php | ||
|
||
echo "paypal with Cyrillic spoof characters\n"; | ||
$x = new Spoofchecker(); | ||
var_dump($x->isSuspicious("http://www.payp\u{0430}l.com")); | ||
var_dump($x->isSuspicious("\u{041F}aypal.com")); | ||
|
||
echo "certain all-uppercase Latin sequences can be spoof of Greek\n"; | ||
$x = new Spoofchecker(); | ||
$x->setAllowedLocales("gr_GR"); | ||
var_dump($x->isSuspicious("NAPKIN PEZ")); | ||
var_dump($x->isSuspicious("napkin pez")); | ||
?> | ||
--EXPECTF-- | ||
paypal with Cyrillic spoof characters | ||
bool(true) | ||
bool(true) | ||
certain all-uppercase Latin sequences can be spoof of Greek | ||
bool(true) | ||
bool(true) |