We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f9513ac + aa3ff70 commit 7d1f6f2Copy full SHA for 7d1f6f2
src/util.cpp
@@ -61,7 +61,14 @@ std::string intToString(int i) {
61
62
std::string urlDecode(std::string input) {
63
std::size_t idxReplaced = 0;
64
- std::size_t idxFound = input.find('%');
+ // First replace + by space
65
+ std::size_t idxFound = input.find('+');
66
+ while (idxFound != std::string::npos) {
67
+ input.replace(idxFound, 1, 1, ' ');
68
+ idxFound = input.find('+', idxFound + 1);
69
+ }
70
+ // Now replace percent-escapes
71
+ idxFound = input.find('%');
72
while (idxFound != std::string::npos) {
73
if (idxFound <= input.length() + 3) {
74
char hex[2] = { input[idxFound+1], input[idxFound+2] };
0 commit comments