1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-05 18:41:05 +00:00

Update directory name sanitization

Only ASCII spaces have to be handles specially, and leading spaces are
also disallowed.
This commit is contained in:
ShadowNinja 2022-01-31 21:11:51 -05:00 committed by rubenwardy
parent 65fdc7ae50
commit dae6fe91a1
3 changed files with 23 additions and 30 deletions

View file

@ -749,7 +749,7 @@ inline irr::core::stringw utf8_to_stringw(const std::string &input)
/**
* Sanitize the name of a new directory. This consists of two stages:
* 1. Check for 'reserved filenames' that can't be used on some filesystems
* and prefix them
* and add a prefix to them
* 2. Remove 'unsafe' characters from the name by replacing them with '_'
*/
std::string sanitizeDirName(const std::string &str, const std::string &optional_prefix);