From f893d9ec41578c0981507dccc41d1ee2a11f6bae Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 31 Jul 2012 14:06:10 +0200 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') 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; -- cgit v1.2.3