mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibURL: Also remove carriage returns from URL input
The definition of an "ASCII tab or newline" also includes U+000D CR. This fixes 3 subtests in: https://wpt.live/url/url-constructor.any.html
This commit is contained in:
parent
a342370dfb
commit
41cf9f6fe3
Notes:
github-actions[bot]
2024-08-05 12:56:58 +00:00
Author: https://github.com/shannonbooth
Commit: 41cf9f6fe3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/967
3 changed files with 34 additions and 6 deletions
|
@ -845,9 +845,9 @@ URL Parser::basic_parse(StringView raw_input, Optional<URL> const& base_url, Opt
|
|||
// 2. If input contains any ASCII tab or newline, invalid-URL-unit validation error.
|
||||
// 3. Remove all ASCII tab or newline from input.
|
||||
for (auto const ch : processed_input) {
|
||||
if (ch == '\t' || ch == '\n') {
|
||||
if (ch == '\t' || ch == '\n' || ch == '\r') {
|
||||
report_validation_error();
|
||||
processed_input = processed_input.replace("\t"sv, ""sv, ReplaceMode::All).replace("\n"sv, ""sv, ReplaceMode::All);
|
||||
processed_input = processed_input.replace("\t"sv, ""sv, ReplaceMode::All).replace("\n"sv, ""sv, ReplaceMode::All).replace("\r"sv, ""sv, ReplaceMode::All);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue