[DEV] update regex special char properties
This commit is contained in:
parent
ab6fbbdfed
commit
a4c544e916
@ -29,11 +29,11 @@ static std::string replaceSpecialChar(const std::string& _inval) {
|
|||||||
static std::regex regexQUOT(""");
|
static std::regex regexQUOT(""");
|
||||||
static std::regex regexAMP("&");
|
static std::regex regexAMP("&");
|
||||||
|
|
||||||
out = std::regex_replace(_inval, regexLT, "<");
|
out = std::regex_replace(_inval, regexLT, std::string("<"));
|
||||||
out = std::regex_replace(out, regexGT, ">");
|
out = std::regex_replace(out, regexGT, std::string(">"));
|
||||||
out = std::regex_replace(out, regexAPOS, "'");
|
out = std::regex_replace(out, regexAPOS, std::string("'"));
|
||||||
out = std::regex_replace(out, regexQUOT, "\"");
|
out = std::regex_replace(out, regexQUOT, std::string("\""));
|
||||||
out = std::regex_replace(out, regexAMP, "&");
|
out = std::regex_replace(out, regexAMP, std::string("&"));
|
||||||
//EXML_ERROR("plop "<< _inval << " => " << out);
|
//EXML_ERROR("plop "<< _inval << " => " << out);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -45,11 +45,11 @@ static std::string replaceSpecialCharOut(const std::string& _inval) {
|
|||||||
static std::regex regexAPOS("'");
|
static std::regex regexAPOS("'");
|
||||||
static std::regex regexQUOT("\"");
|
static std::regex regexQUOT("\"");
|
||||||
|
|
||||||
out = std::regex_replace(_inval, regexAMP, "&");
|
out = std::regex_replace(_inval, regexAMP, std::string("&"));
|
||||||
out = std::regex_replace(out, regexQUOT, """);
|
out = std::regex_replace(out, regexQUOT, std::string("""));
|
||||||
out = std::regex_replace(out, regexAPOS, "'");
|
out = std::regex_replace(out, regexAPOS, std::string("'"));
|
||||||
out = std::regex_replace(out, regexGT, ">");
|
out = std::regex_replace(out, regexGT, std::string(">"));
|
||||||
out = std::regex_replace(out, regexLT, "<");
|
out = std::regex_replace(out, regexLT, std::string("<"));
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user