mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-18 17:46:09 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/4aaf8df8657 Pull-request: https://github.com/SerenityOS/serenity/pull/6759 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/sin-ack
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…
Reference in a new issue