diff --git a/src/map/house/house.cpp b/src/map/house/house.cpp index e1225aa9370..8bb26bcfb6b 100644 --- a/src/map/house/house.cpp +++ b/src/map/house/house.cpp @@ -502,7 +502,20 @@ bool House::executeTransfer(std::shared_ptr item, std::shared } void AccessList::parseList(const std::string &list) { - std::string validList = validateNameHouse(list); + std::regex regexValidChars("[^a-zA-Z' \n*!@#]+"); + std::string validList = std::regex_replace(list, regexValidChars, ""); + + // Remove empty lines + std::istringstream iss(validList); + std::ostringstream oss; + std::string line; + while (std::getline(iss, line)) { + if (!line.empty()) { + oss << line << '\n'; + } + } + validList = oss.str(); + playerList.clear(); guildRankList.clear(); allowEveryone = false; diff --git a/src/utils/tools.cpp b/src/utils/tools.cpp index f5a8597eb9c..ea927bc5189 100644 --- a/src/utils/tools.cpp +++ b/src/utils/tools.cpp @@ -1511,17 +1511,6 @@ void consoleHandlerExit() { return; } -std::string validateNameHouse(const std::string &list) { - std::string result; - for (char c : list) { - if (isalpha(c) || c == ' ' || c == '\'' || c == '!' || c == '\n' - || c == '?' || c == '#' || c == '@' || c == '*') { - result += c; - } - } - return result; -} - NameEval_t validateName(const std::string &name) { StringVector prohibitedWords = { "owner", "gamemaster", "hoster", "admin", "staff", "tibia", "account", "god", "anal", "ass", "fuck", "sex", "hitler", "pussy", "dick", "rape", "cm", "gm", "tutor", "counsellor", "god" }; StringVector toks; diff --git a/src/utils/tools.hpp b/src/utils/tools.hpp index fd6b41d1f3c..14e9fd39416 100644 --- a/src/utils/tools.hpp +++ b/src/utils/tools.hpp @@ -126,7 +126,6 @@ const char* getReturnMessage(ReturnValue value); void sleep_for(uint64_t ms); void capitalizeWords(std::string &source); void consoleHandlerExit(); -std::string validateNameHouse(const std::string &name); NameEval_t validateName(const std::string &name); bool isCaskItem(uint16_t itemId);