diff options
author | Alexis Menard <alexis.menard@openbossa.org> | 2012-05-09 13:34:17 -0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-09 20:10:44 +0200 |
commit | 92d4e843bd200adbf52d397790509667f2f63913 (patch) | |
tree | dbe3387fec276acaaf5d427a047cc06f1dcb97b2 /src/corelib/io/qdataurl.cpp | |
parent | 4e9dc8b49d97f1955875c727dbcdbcbb20999428 (diff) |
Fix qDecodeDataUrl for already percentage encoded content.
If the url we pass as parameter already have percentage encoded data,
we don't want to decode it and call fromPercentEncoding. The test
coverage is not complete for qdataurl.cpp file but it is better than
previously and it will also protect us from future regressions.
Change-Id: I79f709f44bed1b7f274a3de639c7e291fa91a193
Reviewed-by: Thiago Macieira
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdataurl.cpp')
-rw-r--r-- | src/corelib/io/qdataurl.cpp | 4 |
1 files changed, 2 insertions, 2 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(','); |