diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-01-19 16:39:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-23 07:38:34 +0100 |
commit | 69920f4ddeaa5dbdee555e0a607fd21eb42e2bbc (patch) | |
tree | 7bf29cf79ae1ba33d92ac7b0e2dd27dd48346bfa /examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml | |
parent | e6b224aa2872d7d1030fa98bd30603e16f8f9604 (diff) |
Encode user input before insertion into URLs
Encode user input strings used to formulate URLs, to ensure they do not
cause the structure of the URL to be subverted.
Task-number: QTBUG-19925
Change-Id: I6173f4df67a4bc1676ac32be6072763fc16f9720
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml')
-rw-r--r-- | examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml b/examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml index 4126367dff..9438637ebc 100644 --- a/examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml +++ b/examples/declarative/photoviewer/PhotoViewerCore/RssModel.qml @@ -45,7 +45,9 @@ import QtQuick.XmlListModel 2.0 XmlListModel { property string tags : "" - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "") + function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); } + + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(tags)+"&" : "") query: "/feed/entry" namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" |