From 521a38d9c50a800fec801f522d8292cc1596f8b5 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 31 Jan 2021 18:44:40 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/OutOfProcessWebView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(""); - builder.appendff("The web page {} has crashed.

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 {} has crashed.

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(""); load_html(builder.to_string(), m_url); };