mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +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:
committed by
Linus Groh
parent
78bc6c09ba
commit
4aaf8df865
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user