mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 07:53:44 +00:00
feat(Core/Chat): new argument parsing and unify chat hyperlink parsing (#6243)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "PacketUtilities.h"
|
||||
//#include "Hyperlinks.h"
|
||||
#include "Hyperlinks.h"
|
||||
#include "Errors.h"
|
||||
#include <utf8.h>
|
||||
#include <sstream>
|
||||
@@ -41,13 +41,13 @@ bool WorldPackets::Strings::Utf8::Validate(std::string const& value)
|
||||
return true;
|
||||
}
|
||||
|
||||
//bool WorldPackets::Strings::Hyperlinks::Validate(std::string const& value)
|
||||
//{
|
||||
// if (!Acore::Hyperlinks::CheckAllLinks(value))
|
||||
// throw InvalidHyperlinkException(value);
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
bool WorldPackets::Strings::Hyperlinks::Validate(std::string const& value)
|
||||
{
|
||||
if (!Acore::Hyperlinks::CheckAllLinks(value))
|
||||
throw InvalidHyperlinkException(value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WorldPackets::Strings::NoHyperlinks::Validate(std::string const& value)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace WorldPackets
|
||||
template<std::size_t MaxBytesWithoutNullTerminator>
|
||||
struct ByteSize { static bool Validate(std::string const& value) { return value.size() <= MaxBytesWithoutNullTerminator; } };
|
||||
struct Utf8 { static bool Validate(std::string const& value); };
|
||||
//struct Hyperlinks { static bool Validate(std::string const& value); };
|
||||
struct Hyperlinks { static bool Validate(std::string const& value); };
|
||||
struct NoHyperlinks { static bool Validate(std::string const& value); };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user