aboutsummaryrefslogtreecommitdiff
path: root/backends/networking
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-08 16:30:11 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commiteaa5fb175939c819785095d23bd67e3514144ec7 (patch)
treeec1f1033284f65edbd6e702dd09c6008f8bfbbc1 /backends/networking
parentf0fc18d2ee02c61524486aa1e73b781a6f64ef23 (diff)
downloadscummvm-rg350-eaa5fb175939c819785095d23bd67e3514144ec7.tar.gz
scummvm-rg350-eaa5fb175939c819785095d23bd67e3514144ec7.tar.bz2
scummvm-rg350-eaa5fb175939c819785095d23bd67e3514144ec7.zip
CLOUD: Put "/upload" "path" parameter in the URL
Diffstat (limited to 'backends/networking')
-rw-r--r--backends/networking/sdl_net/handlers/filespagehandler.cpp15
-rw-r--r--backends/networking/wwwroot.zipbin231030 -> 230985 bytes
-rw-r--r--backends/networking/wwwroot/.files.html3
3 files changed, 14 insertions, 4 deletions
diff --git a/backends/networking/sdl_net/handlers/filespagehandler.cpp b/backends/networking/sdl_net/handlers/filespagehandler.cpp
index c21575dc61..228bf7657b 100644
--- a/backends/networking/sdl_net/handlers/filespagehandler.cpp
+++ b/backends/networking/sdl_net/handlers/filespagehandler.cpp
@@ -34,6 +34,17 @@ FilesPageHandler::FilesPageHandler() {}
FilesPageHandler::~FilesPageHandler() {}
+namespace {
+Common::String encodeDoubleQuotes(Common::String s) {
+ Common::String result = "";
+ for (uint32 i = 0; i < s.size(); ++i)
+ if (s[i] == '"') {
+ result += "\\\"";
+ } else result += s[i];
+ return result;
+}
+}
+
void FilesPageHandler::handle(Client &client) {
Common::String response = "<html><head><title>ScummVM</title></head><body><table>{content}</table></body></html>"; //TODO: add controls
Common::String itemTemplate = "<tr><td><a href=\"{link}\">{name}</a></td><td>{size}</td></tr>\n"; //TODO: load this template too?
@@ -62,8 +73,8 @@ void FilesPageHandler::handle(Client &client) {
//these occur twice:
replace(response, "{create_directory_button}", _("Create directory"));
replace(response, "{create_directory_button}", _("Create directory"));
- replace(response, "{path}", client.queryParameter("path"));
- replace(response, "{path}", client.queryParameter("path"));
+ replace(response, "{path}", encodeDoubleQuotes(client.queryParameter("path")));
+ replace(response, "{path}", encodeDoubleQuotes(client.queryParameter("path")));
replace(response, "{upload_files_button}", _("Upload files")); //tab
replace(response, "{upload_file_button}", _("Upload files")); //button in the tab
replace(response, "{create_directory_desc}", _("Type new directory name:"));
diff --git a/backends/networking/wwwroot.zip b/backends/networking/wwwroot.zip
index 7049289858..a57355e9f3 100644
--- a/backends/networking/wwwroot.zip
+++ b/backends/networking/wwwroot.zip
Binary files differ
diff --git a/backends/networking/wwwroot/.files.html b/backends/networking/wwwroot/.files.html
index 0651346e21..d14acfcd36 100644
--- a/backends/networking/wwwroot/.files.html
+++ b/backends/networking/wwwroot/.files.html
@@ -25,8 +25,7 @@
</div>
<div id="upload_file" class="modal">
<p>{upload_file_desc}</p>
- <form action="upload" method="post" enctype="multipart/form-data">
- <input type="hidden" name="path" value="{path}"/>
+ <form action="upload?path={path}" method="post" enctype="multipart/form-data">
<input type="file" name="upload_file"/>
<input type="submit" value="{upload_file_button}"/>
</form>