1
0
Fork 0

utils: html_xss(): Add ' and &

They REALLY should have been there from the beginning...
Dieser Commit ist enthalten in:
Albert S. 2021-06-15 18:21:47 +02:00
Ursprung a930b7aea6
Commit 88816a4015
1 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -46,6 +46,12 @@ std::string utils::html_xss(std::string_view str)
case '%':
result += "%";
break;
case '\'':
result += "'";
break;
case '&':
result += "&";
break;
default:
result += c;
}
@ -93,7 +99,7 @@ std::vector<std::string> utils::split(const std::string &str, char delim)
// TODO: can easily break if we pass a regex here
std::vector<std::string> utils::split(const std::string &str, const std::string &delim)
{
std::regex regex { delim + "+" };
std::regex regex{delim + "+"};
return split(str, regex);
}