| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f9513ac commit e7eaf28
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,14 @@ std::string intToString(int i) { | |||
| 61 | 61 | ||
| 62 | 62 | std::string urlDecode(std::string input) { | |
| 63 | 63 | std::size_t idxReplaced = 0; | |
| 64 | - std::size_t idxFound = input.find('%'); | ||
| 64 | + // 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); | ||
| 69 | + } | ||
| 70 | + // Now replace percent-escapes | ||
| 71 | + idxFound = input.find('%'); | ||
| 65 | 72 | while (idxFound != std::string::npos) { | |
| 66 | 73 | if (idxFound <= input.length() + 3) { | |
| 67 | 74 | char hex[2] = { input[idxFound+1], input[idxFound+2] }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments