summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-07-31 14:06:10 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-01 13:04:15 +0200
commitf893d9ec41578c0981507dccc41d1ee2a11f6bae (patch)
tree16f46fa392aaaa6c56fce74347f71341c6472a5d /src/corelib
parent4d1f0ccbf31c7aed9629e6b9e9bdd6b903119b11 (diff)
Fix QUrl support for empty usernames and passwords
If the password is empty (but present), the userinfo component of the URL should end in a colon (":"). QUrl already supported that and it was tested (case "password-empty"). If the username is *also* empty but present, the userinfo component is just the colon (":"). Fix support for that case by checking if we stored the presence flag instead of checking the size of the component. Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qurl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index b009073848..ff1f7ba78c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -563,7 +563,7 @@ inline void QUrlPrivate::appendAuthority(QString &appendTo, QUrl::FormattingOpti
inline void QUrlPrivate::appendUserInfo(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
{
- if (Q_LIKELY(userName.isEmpty() && password.isEmpty()))
+ if (Q_LIKELY(!hasUserInfo()))
return;
const ushort *userNameActions;