Преглед изворни кода

Merge 719a69215ddc00f6fbac2accd80e72f0134d7185 into 3eefa464eef2278f3f8c311aa5905bf6c0bb011e

Ashwin Paudel пре 6 месеци
родитељ
комит
fac82195da
1 измењених фајлова са 5 додато и 7 уклоњено
  1. 5 7
      Libraries/LibWebView/URL.cpp

+ 5 - 7
Libraries/LibWebView/URL.cpp

@@ -39,14 +39,12 @@ Optional<URL::URL> sanitize_url(StringView url, Optional<StringView> search_engi
     }
     }
 
 
     ByteString url_with_scheme = url;
     ByteString url_with_scheme = url;
-    if (!(url_with_scheme.starts_with("about:"sv) || url_with_scheme.contains("://"sv) || url_with_scheme.starts_with("data:"sv)))
+    if (!(url_with_scheme.starts_with("about:"sv) || url_with_scheme.contains("://"sv) || url_with_scheme.starts_with("data:"sv) || url_with_scheme.contains("."sv)) {
         url_with_scheme = ByteString::formatted("https://{}"sv, url_with_scheme);
         url_with_scheme = ByteString::formatted("https://{}"sv, url_with_scheme);
-
-    auto result = URL::create_with_url_or_path(url_with_scheme);
-    if (!result.is_valid())
-        return format_search_engine();
-
-    return result;
+        return URL::create_with_url_or_path(url_with_scheme);
+    }
+    
+    return format_search_engine();;
 }
 }
 
 
 Vector<URL::URL> sanitize_urls(ReadonlySpan<ByteString> raw_urls, URL::URL const& new_tab_page_url)
 Vector<URL::URL> sanitize_urls(ReadonlySpan<ByteString> raw_urls, URL::URL const& new_tab_page_url)