mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
LibWeb: Fix hex character references accepting all alphabetic ASCII
Instead of just A-F/a-f, any char A-Z/a-z was being accepted as a valid hexadecimal digit.
This commit is contained in:
parent
df87a9689c
commit
1ba15e1fa3
Notes:
github-actions[bot]
2025-01-06 23:44:42 +00:00
Author: https://github.com/squeek502
Commit: 1ba15e1fa3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3163
Reviewed-by: https://github.com/gmta ✅
4 changed files with 93 additions and 9 deletions
|
@ -1819,16 +1819,11 @@ _StartOfFunction:
|
|||
m_character_reference_code += current_input_character.value() - 0x30;
|
||||
continue;
|
||||
}
|
||||
ON_ASCII_UPPER_ALPHA
|
||||
ON_ASCII_HEX_DIGIT
|
||||
{
|
||||
m_character_reference_code *= 16;
|
||||
m_character_reference_code += current_input_character.value() - 0x37;
|
||||
continue;
|
||||
}
|
||||
ON_ASCII_LOWER_ALPHA
|
||||
{
|
||||
m_character_reference_code *= 16;
|
||||
m_character_reference_code += current_input_character.value() - 0x57;
|
||||
auto hex_digit_min_ascii_value = is_ascii_upper_alpha(current_input_character.value()) ? 0x37 : 0x57;
|
||||
m_character_reference_code += current_input_character.value() - hex_digit_min_ascii_value;
|
||||
continue;
|
||||
}
|
||||
ON(';')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue