1
0
mirror of synced 2025-02-06 14:14:22 +01:00

fix: URL Decoding not working correctly

This commit is contained in:
WerWolv 2023-11-17 13:13:17 +01:00
parent 4a44cddcea
commit 3bd779a607
3 changed files with 5 additions and 5 deletions

View File

@ -118,9 +118,9 @@ namespace hex {
template<typename T = std::string> template<typename T = std::string>
std::future<Result<T>> execute(); std::future<Result<T>> execute();
std::string urlEncode(const std::string &input); static std::string urlEncode(const std::string &input);
std::string urlDecode(const std::string &input); static std::string urlDecode(const std::string &input);
protected: protected:
void setDefaultConfig(); void setDefaultConfig();

View File

@ -51,7 +51,7 @@ namespace hex {
i += 2; i += 2;
} }
} }
return input; return result;
} }
} }

View File

@ -39,7 +39,7 @@ namespace hex::plugin::builtin {
ImGui::EndDisabled(); ImGui::EndDisabled();
if (startSearch && !searchString.empty()) { if (startSearch && !searchString.empty()) {
request.setUrl(getWikipediaApiUrl() + "&exintro"s + "&titles="s + request.urlEncode(searchString)); request.setUrl(getWikipediaApiUrl() + "&exintro"s + "&titles="s + HttpRequest::urlEncode(searchString));
searchProcess = request.execute(); searchProcess = request.execute();
} }
@ -66,7 +66,7 @@ namespace hex::plugin::builtin {
if (!extendedSearch && resultExtract.ends_with(':')) { if (!extendedSearch && resultExtract.ends_with(':')) {
extendedSearch = true; extendedSearch = true;
request.setUrl(getWikipediaApiUrl() + "&titles="s + request.urlEncode(searchString)); request.setUrl(getWikipediaApiUrl() + "&titles="s + HttpRequest::urlEncode(searchString));
searchProcess = request.execute(); searchProcess = request.execute();
resultTitle.clear(); resultTitle.clear();