diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-08 20:41:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-08 22:38:59 +0300 |
commit | c116c209d0d58abef4066e4be20b9a858d278a63 (patch) | |
tree | d1646fb395f6a679b9a80917abfd55217fe6c282 /src/utils/stringutils.cpp | |
parent | a44e5476169f3f7db7fa74ac22d409ef44aad466 (diff) | |
download | plus-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.cpp | 12 |
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; +} |