From 1c35ddee889c6cacd97036c5cf538e2176fe80ac Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Mon, 8 Apr 2013 01:36:52 -0700 Subject: [PATCH] Disable the check for mixed Simplified and Traditional Chinese characters when determining whether to display IDN labels as unicode or punycode. Bug 857481, r=honzab --- netwerk/dns/nsIDNService.cpp | 7 +++++++ netwerk/test/unit/test_bug722299.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/netwerk/dns/nsIDNService.cpp b/netwerk/dns/nsIDNService.cpp index f59629e4edf2..4e9cf0410bdf 100644 --- a/netwerk/dns/nsIDNService.cpp +++ b/netwerk/dns/nsIDNService.cpp @@ -752,7 +752,10 @@ bool nsIDNService::isLabelSafe(const nsAString &label) int32_t lastScript = MOZ_SCRIPT_INVALID; uint32_t previousChar = 0; uint32_t savedNumberingSystem = 0; +// Simplified/Traditional Chinese check temporarily disabled -- bug 857481 +#if 0 HanVariantType savedHanVariant = HVT_NotHan; +#endif int32_t savedScript = -1; @@ -807,6 +810,9 @@ bool nsIDNService::isLabelSafe(const nsAString &label) return false; } + // Simplified/Traditional Chinese check temporarily disabled -- bug 857481 +#if 0 + // Check for both simplified-only and traditional-only Chinese characters HanVariantType hanVariant = GetHanVariant(ch); if (hanVariant == HVT_SimplifiedOnly || hanVariant == HVT_TraditionalOnly) { @@ -816,6 +822,7 @@ bool nsIDNService::isLabelSafe(const nsAString &label) return false; } } +#endif previousChar = ch; } diff --git a/netwerk/test/unit/test_bug722299.js b/netwerk/test/unit/test_bug722299.js index b8672d214446..c3dc8a9a6174 100644 --- a/netwerk/test/unit/test_bug722299.js +++ b/netwerk/test/unit/test_bug722299.js @@ -172,10 +172,10 @@ const testcases = [ ["万城", "xn--chq31v", false, true, true], // Simplified-only and Traditional-only Chinese in the same label - ["万萬城", "xn--chq31vsl1b", false, false, false], + ["万萬城", "xn--chq31vsl1b", false, true, true], // Traditional-only and Simplified-only Chinese in the same label - ["萬万城", "xn--chq31vrl1b", false, false, false], + ["萬万城", "xn--chq31vrl1b", false, true, true], // Han and Latin and Bopomofo ["注音符号bopomofoㄅㄆㄇㄈ",