From f71592a376a363ec818a7d76693c6ba922772fd8 Mon Sep 17 00:00:00 2001 From: "andreas.otte%debitel.net" Date: Sat, 15 Oct 2005 23:03:46 +0000 Subject: [PATCH] extending list of blacklisted characters for bug 309128 [More IDN DNS lookup and URL display problems], r=cbiesinger, sr=darin --- netwerk/base/src/nsURLHelper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/netwerk/base/src/nsURLHelper.cpp b/netwerk/base/src/nsURLHelper.cpp index f3491b7daff8..14b3310dd579 100644 --- a/netwerk/base/src/nsURLHelper.cpp +++ b/netwerk/base/src/nsURLHelper.cpp @@ -897,5 +897,14 @@ PRBool net_IsValidHostName(const nsCSubstring &host) { const char *end = host.EndReading(); - return net_FindCharInSet(host.BeginReading(), end, "%/\\") == end; + // ctrl-chars and !\"#%&'()*+,/;<=>?@\\^{|}\x7f + // if one of these chars is found return false + return net_FindCharInSet(host.BeginReading(), end, + "\x01\x02\x03\x04\x05\x06\x07\x08" + "\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" + "\x11\x12\x13\x14\x15\x16\x17\x18" + "\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20" + "\x21\x22\x23\x25\x26\x27\x28\x29" + "\x2a\x2b\x2c\x2f\x3b\x3c\x3d\x3e" + "\x3f\x40\x5c\x5e\x7b\x7c\x7e\x7f") == end; }