mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
Browser: Do not use AK::Format for search engine formatting
It is too complex because it supports many options that are not used by the search engine. It just makes format validation more complicated. Additionaly, now it's possible to have { } characters in search engine URL (although they are not valid URL characters) :)
This commit is contained in:
parent
78bc6c09ba
commit
4aaf8df865
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,9 @@ namespace Browser {
|
|||
URL url_from_user_input(const String& input)
|
||||
{
|
||||
if (input.starts_with("?") && !g_search_engine.is_null()) {
|
||||
return URL(String::formatted(g_search_engine, urlencode(input.substring(1))));
|
||||
auto url = g_search_engine;
|
||||
url.replace("{}", urlencode(input.substring(1)));
|
||||
return URL(url);
|
||||
}
|
||||
|
||||
auto url = URL(input);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue