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:
parent
16781da4f9
commit
360660947b
3 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue