diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-08-03 00:13:21 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-08-22 13:21:55 +0200 |
commit | 50a64ccd1e4ab29a751cf222e4564c3b2cd5153f (patch) | |
tree | e2742073e14d4d7c47c8360bc09d7ea6e5f4c5c0 | |
parent | f15b4f5043799b3a580c8577ad4466135ca9ae38 (diff) |
Core/Misc: Revert back to using boost::regex, std::wregex doesn't work for name validation
Closes #20094
(cherry picked from commit 6691e41873f255c0f303229b0bd2e5db77a3c879)
-rw-r--r-- | dep/boost/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 8 |
2 files changed, 8 insertions, 19 deletions
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt index e5260c862ff..9d78248d66b 100644 --- a/dep/boost/CMakeLists.txt +++ b/dep/boost/CMakeLists.txt @@ -37,11 +37,6 @@ endif() include (CheckCXXSourceCompiles) -check_cxx_source_compiles(" - #include <regex> - int main() { std::wregex r(L\".*\"); }" - STD_HAS_WORKING_WREGEX) - if (WIN32) # On windows the requirements are higher according to the wiki. set(BOOST_REQUIRED_VERSION 1.66) @@ -49,11 +44,7 @@ else() set(BOOST_REQUIRED_VERSION 1.58) endif() -if (STD_HAS_WORKING_WREGEX) - find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams) -else() - find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams regex) -endif() +find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams regex) # Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS @@ -98,8 +89,6 @@ if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM) -DBOOST_NO_CXX11_SCOPED_ENUMS) endif() -if (NOT STD_HAS_WORKING_WREGEX) - target_compile_definitions(boost - INTERFACE - -DTC_HAS_BROKEN_WSTRING_REGEX) -endif() +target_compile_definitions(boost + INTERFACE + -DTC_HAS_BROKEN_WSTRING_REGEX) diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index cf258e0b3fa..1d74072f3a0 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -1093,7 +1093,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul std::wstring name; ASSERT(Utf8toWStr(namesProfanity->Name, name)); if (namesProfanity->Language != -1) - _nameValidators[namesProfanity->Language].emplace_back(name, Trinity::regex::icase | Trinity::regex::optimize); + _nameValidators[namesProfanity->Language].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize); else { for (uint32 i = 0; i < TOTAL_LOCALES; ++i) @@ -1101,7 +1101,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul if (i == LOCALE_none) continue; - _nameValidators[i].emplace_back(name, Trinity::regex::icase | Trinity::regex::optimize); + _nameValidators[i].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize); } } } @@ -1110,7 +1110,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul { std::wstring name; ASSERT(Utf8toWStr(namesReserved->Name, name)); - _nameValidators[TOTAL_LOCALES].emplace_back(name, Trinity::regex::icase | Trinity::regex::optimize); + _nameValidators[TOTAL_LOCALES].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize); } for (NamesReservedLocaleEntry const* namesReserved : sNamesReservedLocaleStore) @@ -1124,7 +1124,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul continue; if (namesReserved->LocaleMask & (1 << i)) - _nameValidators[i].emplace_back(name, Trinity::regex::icase | Trinity::regex::optimize); + _nameValidators[i].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize); } } |