Bug 1800628 - Block U+02BB and U+02BC r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D204105
This commit is contained in:
Valentin Gosu 2024-03-12 14:22:42 +00:00
parent 3d76fa7d1e
commit ce9712e875
2 changed files with 7 additions and 2 deletions

View File

@ -758,6 +758,11 @@ bool nsIDNService::isLabelSafe(const nsAString& label, const nsAString& tld) {
return false;
}
// Block single/double-quote-like characters.
if (ch == 0x2BB || ch == 0x2BC) {
return false;
}
// Check for mixed numbering systems
auto genCat = GetGeneralCategory(ch);
if (genCat == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) {

View File

@ -708,9 +708,9 @@ let testCases = [
// Block single/double-quote-like characters.
// U+02BB (ʻ)
["xn--ab-8nb.com", "a\u02bbb.com", kUnsafe, "DISABLED"],
["xn--ab-8nb.com", "a\u02bbb.com", kUnsafe],
// U+02BC (ʼ)
["xn--ab-cob.com", "a\u02bcb.com", kUnsafe, "DISABLED"],
["xn--ab-cob.com", "a\u02bcb.com", kUnsafe],
// U+144A: Not allowed to mix with scripts other than Canadian Syllabics.
["xn--ab-jom.com", "a\u144ab.com", kUnsafe],
["xn--xcec9s.com", "\u1401\u144a\u1402.com", kUnsafe],