diff options
author | Alexander Harkness <me@bearbin.net> | 2021-08-23 10:35:03 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2021-08-23 10:35:03 +0200 |
commit | 4b8952e438da8e57d6442a0b7451dac8060f154b (patch) | |
tree | 2dfa6aef09599c9e7b768a135abc5fc17c9bf174 /src/StringUtils.cpp | |
parent | Fix typo in message send when getting achievements (#5282) (diff) | |
download | cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar.gz cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar.bz2 cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar.lz cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar.xz cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.tar.zst cuberite-4b8952e438da8e57d6442a0b7451dac8060f154b.zip |
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r-- | src/StringUtils.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index c55456e24..436eeccbb 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -365,6 +365,16 @@ void ReplaceString(AString & iHayStack, const AString & iNeedle, const AString & +void ReplaceURL(AString & iHayStack, const AString & iNeedle, const AString & iReplaceWith) +{ + auto ReplaceWith = URLEncode(iReplaceWith); + ReplaceString(iHayStack, iNeedle, ReplaceWith); +} + + + + + AString & RawBEToUTF8(const char * a_RawData, size_t a_NumShorts, AString & a_UTF8) { a_UTF8.clear(); @@ -817,7 +827,7 @@ AString URLEncode(const AString & a_Text) AString res; auto len = a_Text.size(); res.reserve(len); - static const char HEX[] = "0123456789abcdef"; + static const char HEX[] = "0123456789ABCDEF"; for (size_t i = 0; i < len; ++i) { if (isalnum(a_Text[i])) |