1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-05 08:27:10 +02:00

Fix removal of non alpha-numeric characters from strings.

This commit is contained in:
Sandu Liviu Catalin
2022-07-23 17:42:01 +03:00
parent aa3952fd45
commit 44243aadd2
3 changed files with 6 additions and 4 deletions

View File

@ -114,7 +114,7 @@ int32_t GetSkinID(StackStrF & name)
// Clone the string into an editable version
String str(name.mPtr, static_cast< size_t >(name.mLen));
// Strip non-alphanumeric characters from the name
str.erase(std::remove_if(str.begin(), str.end(), std::function<int(int)>(::isalnum)), str.end());
str.erase(std::remove_if(str.begin(), str.end(), [](char c) -> bool { return std::isalnum(c) == 0; }), str.end());
// Convert the string to lowercase
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
// See if we still have a valid name after the cleanup