summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-08 20:41:48 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-08 22:38:59 +0300
commitc116c209d0d58abef4066e4be20b9a858d278a63 (patch)
treed1646fb395f6a679b9a80917abfd55217fe6c282 /src/utils/stringutils.cpp
parenta44e5476169f3f7db7fa74ac22d409ef44aad466 (diff)
downloadplus-c116c209d0d58abef4066e4be20b9a858d278a63.tar.gz
plus-c116c209d0d58abef4066e4be20b9a858d278a63.tar.bz2
plus-c116c209d0d58abef4066e4be20b9a858d278a63.tar.xz
plus-c116c209d0d58abef4066e4be20b9a858d278a63.zip
Validate update host.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index ea2d18276..9a8040c5d 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -456,4 +456,14 @@ std::vector<std::string> getLang()
if (dot != (signed)std::string::npos)
langs.push_back(lang.substr(0, dot));
return langs;
-} \ No newline at end of file
+}
+
+bool checkPath(std::string path)
+{
+ if (path.empty())
+ return true;
+ return path.find("../") == std::string::npos
+ && path.find("..\\") == std::string::npos
+ && path.find("/..") == std::string::npos
+ && path.find("\\..") == std::string::npos;
+}