diff options
author | Linus Groh <mail@linusgroh.de> | 2021-01-31 18:44:40 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-31 19:05:55 +0100 |
commit | 521a38d9c50a800fec801f522d8292cc1596f8b5 (patch) | |
tree | 257c86a426fd30cd24e82de73637e6ef71e6b2c3 /Userland | |
parent | e0066ff2d75089fb6ac31d90e69e844529f5f97f (diff) | |
download | serenity-521a38d9c50a800fec801f522d8292cc1596f8b5.zip |
LibWeb: Use URL::to_string_encoded() for the crash error page URL's href
Just wrapping to_string() in urlencode() will break the link as too many
characters are encoded. Also wrap in escape_html_entities() as well -
most relevant chars are already URL-encoded, but this will change '&' to
'&', for example.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/OutOfProcessWebView.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp index ff0eb2b63c..b731c0c6ea 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -69,7 +69,7 @@ void OutOfProcessWebView::create_client() builder.appendff(" on {}", escape_html_entities(m_url.host())); } builder.append("</h1>"); - builder.appendff("The web page <a href='{}'>{}</a> has crashed.<br><br>You can reload the page to try again.", AK::urlencode(m_url.to_string()), escape_html_entities(m_url.to_string())); + builder.appendff("The web page <a href=\"{}\">{}</a> has crashed.<br><br>You can reload the page to try again.", escape_html_entities(m_url.to_string_encoded()), escape_html_entities(m_url.to_string())); builder.append("</body></html>"); load_html(builder.to_string(), m_url); }; |