diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2025-04-22 22:23:32 +0200 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2025-05-24 01:12:55 +0300 |
| commit | cec5066f322609c39040d53e314021600e50027b (patch) | |
| tree | d2a436986020cb5df271338515acf0dedab98d8e /src/corelib/io/qdataurl.cpp | |
| parent | 71bcd74542e37825cb1837f162b5b2310b6ebcb9 (diff) | |
qdataurl: treat comma as mandatory in the data URL syntax
In the syntax specified in https://www.rfc-editor.org/rfc/rfc2397.html:
data:[<mediatype>][;base64],<data>
The comma isn't inside square brackets, so not optional.
Change the unittests accordingly, "data:text/plain" isn't empty data,
it's rather malformed.
[ChangeLog][QtCore] Changed parsing 'data:' URLs to report failure if
the comma is missing, this makes it more compliant with RFC 2397.
[ChangeLog][QtNetwork][QNetworkManager] Changed parsing 'data:' URLs to
report failure if the comma is missing, this makes it more compliant
RFC 2397.
Change-Id: I91c45f42257de7840ab45c0f8eb31b8df3d483bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdataurl.cpp')
| -rw-r--r-- | src/corelib/io/qdataurl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp index 2d2426e8ea5..208a432e7a6 100644 --- a/src/corelib/io/qdataurl.cpp +++ b/src/corelib/io/qdataurl.cpp @@ -56,9 +56,10 @@ Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray mimeType = textPlain + QLatin1StringView(data.trimmed()); else mimeType = QStringLiteral("text/plain;charset=US-ASCII"); + return true; } - return true; + return false; } QT_END_NAMESPACE |
