1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

LuaSettings: Sanitize setting name strings

This commit is contained in:
kwolekr 2014-11-30 19:01:37 -05:00
parent 16781da4f9
commit 360660947b
3 changed files with 12 additions and 1 deletions

View file

@ -63,6 +63,16 @@ Settings & Settings::operator = (const Settings &other)
}
std::string Settings::sanitizeString(const std::string &value)
{
std::string str = value;
for (const char *s = "\t\n\v\f\r\b =\""; *s; s++)
str.erase(std::remove(str.begin(), str.end(), *s), str.end());
return str;
}
std::string Settings::getMultiline(std::istream &is)
{
std::string value;