We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab4c03c commit ec83555Copy full SHA for ec83555
AK/URL.cpp
@@ -47,6 +47,9 @@ static inline bool is_digit(char ch)
47
48
bool URL::parse(const StringView& string)
49
{
50
+ if (string.is_null())
51
+ return false;
52
+
53
enum class State {
54
InProtocol,
55
InHostname,
@@ -291,10 +294,16 @@ String URL::to_string() const
291
294
292
295
URL URL::complete_url(const String& string) const
293
296
297
+ if (!is_valid())
298
+ return {};
299
300
URL url(string);
301
if (url.is_valid())
302
return url;
303
304
+ if (protocol() == "data")
305
306
307
if (string.starts_with("//")) {
308
URL url(String::format("%s:%s", m_protocol.characters(), string.characters()));
309
0 commit comments