1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

Ladybird/Qt: Sanitize user-provided URLs with LibWebView

This commit is contained in:
Timothy Flynn 2023-10-13 09:52:06 -04:00 committed by Tim Flynn
parent 191e20d639
commit f023e37de7
8 changed files with 26 additions and 50 deletions

View file

@ -121,12 +121,6 @@ ErrorOr<void> AutoComplete::got_network_response(QNetworkReply* reply)
return Error::from_string_view("Invalid engine name"sv);
}
ErrorOr<String> AutoComplete::search_url_from_query(StringView query)
{
auto search_engine = TRY(ak_string_from_qstring(Settings::the()->search_engine().url));
return search_engine.replace("{}"sv, AK::URL::percent_encode(query), ReplaceMode::FirstOnly);
}
ErrorOr<String> AutoComplete::auto_complete_url_from_query(StringView query)
{
auto autocomplete_engine = TRY(ak_string_from_qstring(Settings::the()->autocomplete_engine().url));