aboutsummaryrefslogtreecommitdiff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-08 21:02:51 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:38:23 +0200
commit0cae593b94c4fdfe100516c7f08f75e40bc1e089 (patch)
treedc74c8fccce760d9b85247cc1e401890ef09f424 /src/Cache.cpp
parent983be4253f2ea3827d78db97afcc666664ae75ed (diff)
Move room setName to its own function, escape commands
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 82f31b9..bb87857 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -3,6 +3,7 @@
#include "../include/dchat/FileUtil.hpp"
#include "../include/dchat/Gif.hpp"
#include "../include/dchat/Storage.hpp"
+#include "../include/dchat/Process.hpp"
#include <boost/filesystem/convenience.hpp>
#include <process.hpp>
#include <odhtdb/Hash.hpp>
@@ -351,8 +352,8 @@ namespace dchat
string downloadLimitBytesStr = to_string(downloadLimitBytes);
std::string cmdUtf8 = "curl -L --silent -o '";
- cmdUtf8 += filepath.string();
- cmdUtf8 += "' --max-filesize " + downloadLimitBytesStr + " --range 0-" + downloadLimitBytesStr + " --url '" + url + "'";
+ cmdUtf8 += escapeCommand(filepath.string());
+ cmdUtf8 += "' --max-filesize " + downloadLimitBytesStr + " --range 0-" + downloadLimitBytesStr + " --url '" + escapeCommand(url) + "'";
Process::string_type cmd = toNativeString(cmdUtf8);
// TODO: Use this instead of curl on windows: certutil.exe -urlcache -split -f "https://url/to/file" path/and/name/to/save/as/file
Process *process = new Process(cmd, toNativeString(""), nullptr, nullptr, false);