mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb/HTML: Explicitly basic parse URL when following the hyperlink
Instead of relying on the implicit URL constuctor. Parsing should never fail here as urlString before adding the suffix is already parsed above, and the suffix should only be a valid query string.
This commit is contained in:
Notes:
github-actions[bot]
2025-03-04 21:26:33 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/1257d0c1a8c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3668 Reviewed-by: https://github.com/trflynn89
@@ -518,7 +518,9 @@ void HTMLHyperlinkElementUtils::follow_the_hyperlink(Optional<String> hyperlink_
|
||||
// FIXME: 12. If subject's link types includes the noreferrer keyword, then set referrerPolicy to "no-referrer".
|
||||
|
||||
// 13. Navigate targetNavigable to urlString using subject's node document, with referrerPolicy set to referrerPolicy and userInvolvement set to userInvolvement.
|
||||
MUST(target_navigable->navigate({ .url = url_string, .source_document = hyperlink_element_utils_document(), .referrer_policy = referrer_policy, .user_involvement = user_involvement }));
|
||||
auto url = URL::Parser::basic_parse(url_string);
|
||||
VERIFY(url.has_value());
|
||||
MUST(target_navigable->navigate({ .url = url.release_value(), .source_document = hyperlink_element_utils_document(), .referrer_policy = referrer_policy, .user_involvement = user_involvement }));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user