summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2009-10-12 21:22:54 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-13 08:20:52 (GMT)
commitfc5e8bb849232cce27d5f53491cd01628abad760 (patch)
tree6ead54ff7dfb38ff3b1123a1a35db89f8f1c15b9 /src/corelib
parent2d2e422107a93a2a84ba74399678496619329e58 (diff)
downloadQt-fc5e8bb849232cce27d5f53491cd01628abad760.zip
Qt-fc5e8bb849232cce27d5f53491cd01628abad760.tar.gz
Qt-fc5e8bb849232cce27d5f53491cd01628abad760.tar.bz2
Fix QUrl regression with setHost("::ffff:129.144.52.38")
toEncoded was returning an empty host instead of [::ffff:129.144.52.38] Merge-request: 1735 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qurl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 22d0019..6001d9d 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3874,10 +3874,15 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const
}
}
- if (host.startsWith(QLatin1Char('[')))
+ if (host.startsWith(QLatin1Char('['))) {
url += host.toLatin1();
- else
+ } else if (host.contains(QLatin1Char(':'))) {
+ url += '[';
+ url += host.toLatin1();
+ url += ']';
+ } else {
url += QUrl::toAce(host);
+ }
if (!(options & QUrl::RemovePort) && port != -1) {
url += ':';
url += QString::number(port).toAscii();