mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Revert back to using boost::regex, std::wregex doesn't work for name validation
Closes #20094
This commit is contained in:
@@ -34,11 +34,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.59)
|
||||
@@ -46,11 +41,7 @@ else()
|
||||
set(BOOST_REQUIRED_VERSION 1.55)
|
||||
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
|
||||
|
||||
@@ -91,8 +82,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)
|
||||
|
||||
@@ -435,10 +435,10 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
ASSERT(Utf8toWStr(namesProfanity->Name, wname));
|
||||
|
||||
if (namesProfanity->Language != -1)
|
||||
NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, Trinity::regex::icase | Trinity::regex::optimize);
|
||||
NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
|
||||
else
|
||||
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
|
||||
NamesProfaneValidators[i].emplace_back(wname, Trinity::regex::icase | Trinity::regex::optimize);
|
||||
NamesProfaneValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
|
||||
}
|
||||
|
||||
for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
|
||||
@@ -448,10 +448,10 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
ASSERT(Utf8toWStr(namesReserved->Name, wname));
|
||||
|
||||
if (namesReserved->Language != -1)
|
||||
NamesReservedValidators[namesReserved->Language].emplace_back(wname, Trinity::regex::icase | Trinity::regex::optimize);
|
||||
NamesReservedValidators[namesReserved->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
|
||||
else
|
||||
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
|
||||
NamesReservedValidators[i].emplace_back(wname, Trinity::regex::icase | Trinity::regex::optimize);
|
||||
NamesReservedValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
|
||||
}
|
||||
|
||||
for (PvPDifficultyEntry const* entry : sPvPDifficultyStore)
|
||||
|
||||
Reference in New Issue
Block a user