summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-03-19 13:43:41 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-21 13:48:46 (GMT)
commit4c64137c6dfbfcc5a6fecbb04f5159ec491842e1 (patch)
tree48fc8e532b387d9b9bfecb6ea6658910366e1db6
parent8e6293712a9126c2740bf5628e02325d04721b2e (diff)
downloadQt-4c64137c6dfbfcc5a6fecbb04f5159ec491842e1.zip
Qt-4c64137c6dfbfcc5a6fecbb04f5159ec491842e1.tar.gz
Qt-4c64137c6dfbfcc5a6fecbb04f5159ec491842e1.tar.bz2
Fix bug in locating non-lowercase TLDs: must lowercase.
Use qt_nameprep after all since it's extremely fast for ASCII only and it does in-place replacement.
-rw-r--r--src/corelib/io/qurl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index fe3ad82..78e314e 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3174,11 +3174,15 @@ static bool qt_is_idn_enabled(const QString &domain)
int idx = domain.lastIndexOf(QLatin1Char('.'));
if (idx == -1)
return false;
- const QChar *tld = domain.constData() + idx + 1;
+
int len = domain.size() - idx - 1;
+ QString tldString(domain.constData() + idx + 1, len);
+ qt_nameprep(&tldString, 0);
+
+ const QChar *tld = tldString.constData();
if (user_idn_whitelist)
- return user_idn_whitelist->contains(QString::fromRawData(tld, len).toLower());
+ return user_idn_whitelist->contains(tldString);
int l = 0;
int r = sizeof(idn_whitelist)/sizeof(const char *) - 1;