mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
AK: Fix logic error in urldecode() percent-decoding
We also need to append the raw consumed value if *either* of the two characters after the % isn't a hex digit, not only if *both* aren't. Fixes #4257.
This commit is contained in:
parent
4c8c149612
commit
ba020a5907
2 changed files with 15 additions and 1 deletions
|
@ -57,7 +57,7 @@ String urldecode(const StringView& input)
|
|||
builder.append(consume());
|
||||
continue;
|
||||
}
|
||||
if (!is_ascii_hex_digit(peek(1)) && !is_ascii_hex_digit(peek(2))) {
|
||||
if (!is_ascii_hex_digit(peek(1)) || !is_ascii_hex_digit(peek(2))) {
|
||||
builder.append(consume());
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue