diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-24 04:07:26 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-24 04:07:26 (GMT) |
commit | 562ff1d1fcb726932aa4483655aa0d4c6a9746f2 (patch) | |
tree | 458e725c4431493bf8433df435b483f97a115bec /src/declarative/qml | |
parent | d33d30719d3c17fc1505e1b508999c76c6abc6b4 (diff) | |
download | Qt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.zip Qt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.tar.gz Qt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.tar.bz2 |
Revert 95aa8c8fc76e2309a629b05994a2677b0887140b.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativecompositetypemanager.cpp | 13 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecontext.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecontext.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 27 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.h | 2 |
5 files changed, 0 insertions, 50 deletions
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index 5160514..c59e5e2 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -539,19 +539,6 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) { - if (imp.type != QDeclarativeScriptParser::Import::Library && !engine->isSafeOrigin(QUrl(imp.uri), unit->imports.baseUrl())) { - QDeclarativeError error; - error.setUrl(unit->imports.baseUrl()); - error.setDescription(tr("\"%1\" is not a safe origin").arg(imp.uri)); - error.setLine(imp.location.start.line); - error.setColumn(imp.location.start.column); - unit->status = QDeclarativeCompositeTypeData::Error; - unit->errorType = QDeclarativeCompositeTypeData::GeneralError; - unit->errors << error; - doComplete(unit); - return 0; - } - QDeclarativeDirComponents qmldircomponentsnetwork; if (imp.type == QDeclarativeScriptParser::Import::Script) continue; diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index f801a88..85896c4 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -361,12 +361,6 @@ QVariant QDeclarativeContext::contextProperty(const QString &name) const return value; } -bool QDeclarativeContext::isSafeOrigin(const QUrl &src) const -{ - Q_D(const QDeclarativeContext); - return !d->data->engine || d->data->engine->isSafeOrigin(src, baseUrl()); -} - /*! Resolves the URL \a src relative to the URL of the containing component. diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h index 959af8b..a349628 100644 --- a/src/declarative/qml/qdeclarativecontext.h +++ b/src/declarative/qml/qdeclarativecontext.h @@ -85,8 +85,6 @@ public: void setBaseUrl(const QUrl &); QUrl baseUrl() const; - bool isSafeOrigin(const QUrl &src) const; - private: friend class QDeclarativeVME; friend class QDeclarativeEngine; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index d7f30d7..d4872e2 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1883,33 +1883,6 @@ QString QDeclarativeEngine::offlineStoragePath() const } /*! - Returns whether \a to_url is considered safe content when reference by - content at \a from_url. - - The default implementation implements: - - \list - \i Relative URLs are safe - \i https content is safe - \i URLs from the same host and port are safe (including no-host) - \endlist - - You should consider whether this convention is adequate for your pareticular application. -*/ -bool QDeclarativeEngine::isSafeOrigin(const QUrl& to_url, const QUrl& from_url) const -{ - if (to_url.isRelative()) - return true; - if (to_url.scheme()==QLatin1String("https")) - return true; - - if (to_url.host() == from_url.host() && to_url.port() == from_url.port()) // including files (with no host) - return true; - - return false; -} - -/*! \internal Returns the result of the merge of \a baseName with \a dir, \a suffixes, and \a prefix. diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index 5c70b18..19e81b6 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -102,8 +102,6 @@ public: static void setObjectOwnership(QObject *, ObjectOwnership); static ObjectOwnership objectOwnership(QObject *); - virtual bool isSafeOrigin(const QUrl& to_url, const QUrl& from_url) const; - Q_SIGNALS: void quit (); |