WBE update
Fixed some things that made the site not work. This is not the final version, just for the demo.
This commit is contained in:
@@ -243,23 +243,16 @@ static void wbe_decoding_url(const char* encoded, char* decoded) {
|
|||||||
// If we encounter a %xx, decode it to ascii
|
// If we encounter a %xx, decode it to ascii
|
||||||
if ((encoded[i] == '%') && (i + 2 < encoded_length)) {
|
if ((encoded[i] == '%') && (i + 2 < encoded_length)) {
|
||||||
|
|
||||||
/*
|
|
||||||
// Decode %xx
|
// Decode %xx
|
||||||
hex_val = (uint32_t)strtoul(&encoded[i + 1], &endptr, 16);
|
hex_val = (uint32_t)strtoul(&encoded[i + 1], &endptr, 16);
|
||||||
|
|
||||||
// Check for conversion errors
|
// Check for conversion errors
|
||||||
if (endptr == &encoded[i + 1] || *endptr != '\0') {
|
if (endptr == &encoded[i + 1] || *endptr != '\0') {
|
||||||
strcpy(decoded, "");
|
|
||||||
LOG_DEBUG("WBE", "URL text conversion error");
|
LOG_DEBUG("WBE", "URL text conversion error");
|
||||||
//return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
decoded[decoded_index++] = (char)hex_val;
|
decoded[decoded_index++] = (char)hex_val;
|
||||||
|
|
||||||
*/
|
|
||||||
// Decode %xx
|
|
||||||
sscanf(&encoded[i + 1], "%2x", &hex_val);
|
|
||||||
decoded[decoded_index++] = (char)hex_val;
|
|
||||||
// Skip 2 characters
|
// Skip 2 characters
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user