diff options
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdataurl.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qurl.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp index 600f650bb5..84b6dd41c7 100644 --- a/src/corelib/io/qdataurl.cpp +++ b/src/corelib/io/qdataurl.cpp @@ -61,8 +61,8 @@ Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray // the following would have been the correct thing, but // reality often differs from the specification. People have // data: URIs with ? and # - //QByteArray data = QByteArray::fromPercentEncoding(uri.path(QUrl::PrettyDecoded).toLatin1()); - QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::PrettyDecoded | QUrl::RemoveScheme).toLatin1()); + //QByteArray data = QByteArray::fromPercentEncoding(uri.path(QUrl::FullyEncoded).toLatin1()); + QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::FullyEncoded | QUrl::RemoveScheme).toLatin1()); // parse it: int pos = data.indexOf(','); diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 649b3a009c..3e711b12ec 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -777,7 +777,7 @@ void QUrlPrivate::setUserInfo(const QString &userInfo, int from, int end) int delimIndex = userInfo.indexOf(QLatin1Char(':'), from); setUserName(userInfo, from, qMin<uint>(delimIndex, end)); - if (delimIndex == -1) { + if (uint(delimIndex) >= uint(end)) { password.clear(); sectionIsPresent &= ~Password; sectionHasError &= ~Password; @@ -2159,7 +2159,7 @@ QString QUrl::toString(FormattingOptions options) const d->appendPath(url, options, QUrlPrivate::FullUrl); // check if we need to remove trailing slashes - if ((options & StripTrailingSlash) && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/'))) + if ((options & StripTrailingSlash) && !d->path.isEmpty() && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/'))) url.chop(1); } |