diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-04-23 22:43:18 -0300 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-04-24 19:29:57 +0000 |
commit | 21dd5d314a75c09250448e5d59dfb9af88c0f7d5 (patch) | |
tree | 313390696b105640688f47abe1d169a75dbcc2de /src/corelib/io/qurlidna.cpp | |
parent | fbb485d4f6985643b27da3cc6c5b5f960c32e74d (diff) |
QUrl: fix IDN whitelist checking when the TLD is in Unicode
The whitelist is kept in ACE form, so if the TLD came in Unicode, we
need to run ToASCII before we can check the whitelist. This is slightly
inefficient because we'll run the same operation later in this domain.
Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
Diffstat (limited to 'src/corelib/io/qurlidna.cpp')
-rw-r--r-- | src/corelib/io/qurlidna.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 16bb924b17..8dd01e0723 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2422,8 +2422,8 @@ static bool qt_is_idn_enabled(const QString &domain) return false; int len = domain.size() - idx - 1; - QString tldString(domain.constData() + idx + 1, len); - qt_nameprep(&tldString, 0); + QString tldString = qt_ACE_do(QString::fromRawData(domain.constData() + idx + 1, len), ToAceOnly, ForbidLeadingDot); + len = tldString.size(); const QChar *tld = tldString.constData(); |