diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-03 09:25:53 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-03 14:55:47 +0200 |
commit | b79b9e35334b3bdd41329f2ea74bc82f3f05ae52 (patch) | |
tree | 9cd483260c969e370c54306c1c4c5a088bc0df41 /src | |
parent | 75ba1ce9114e320cccfbc0c14dd32675ce2e598e (diff) |
Create a URL from the import string before adding the qmldir path
Otherwise the path might get interpreted as some other part of the URL,
for example the host name.
Fixes: QTBUG-76441
Change-Id: I3edde96153403962db4576e5af794419c21b49a8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index df6a8f1500..9e5bc0b021 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1495,7 +1495,11 @@ bool QQmlTypeLoader::Blob::addImport(const QV4::CompiledData::Import *import, QL bool incomplete = false; - QUrl qmldirUrl = finalUrl().resolved(QUrl(importUri + QLatin1String("/qmldir"))); + QUrl importUrl(importUri); + QString path = importUrl.path(); + path.append(QLatin1String(path.endsWith(QLatin1Char('/')) ? "qmldir" : "/qmldir")); + importUrl.setPath(path); + QUrl qmldirUrl = finalUrl().resolved(importUrl); if (!QQmlImports::isLocal(qmldirUrl)) { // This is a remote file; the import is currently incomplete incomplete = true; |