Adds function removeBracketsIfNeeded to utils

This commit is contained in:
Felipe Zimmerle 2016-06-23 23:11:49 -03:00
parent 7317079945
commit 74a34261ab
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,14 @@ int urldecode_nonstrict_inplace(unsigned char *input,
}
std::string removeBracketsIfNeeded(std::string a) {
if ((a.at(0) == '"') and (a.at(a.length()-1) == '"')) {
a.pop_back();
a.erase(0, 1);
}
return a;
}
std::vector<std::string> split(std::string str, char delimiter) {
std::vector<std::string> internal;

View File

@ -60,6 +60,7 @@ namespace modsecurity {
std::vector<std::string> expandEnv(const std::string& var, int flags);
std::string find_resource(const std::string& file,
const std::string& param);
std::string removeBracketsIfNeeded(std::string a);
} // namespace modsecurity