From 9a8dd38493f7860f2b0485dc9edca01e97230803 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 21 Apr 2021 23:35:24 +0200 Subject: [PATCH] LibWeb+Base: Convert String::format() to String::formatted() This error page template is slightly hilarious and should probably be replaced with AK::SourceGenerator or some such, but for now let's just get rid of the call to String::format(). --- Base/res/html/error.html | 4 ++-- Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Base/res/html/error.html b/Base/res/html/error.html index 058ae0514a..8b06ed12a8 100644 --- a/Base/res/html/error.html +++ b/Base/res/html/error.html @@ -14,8 +14,8 @@
Warning -

Failed to load %s

+

Failed to load {}

-

Error: %s

+

Error: {}

diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 44ce09bfc5..d547580117 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -227,10 +227,10 @@ void FrameLoader::load_error_page(const URL& failed_url, const String& error) [this, failed_url, error](auto data, auto&, auto) { VERIFY(!data.is_null()); #pragma GCC diagnostic ignored "-Wformat-nonliteral" - auto html = String::format( - String::copy(data).characters(), - escape_html_entities(failed_url.to_string()).characters(), - escape_html_entities(error).characters()); + auto html = String::formatted( + data, + escape_html_entities(failed_url.to_string()), + escape_html_entities(error)); #pragma GCC diagnostic pop auto document = HTML::parse_html_document(html, failed_url, "utf-8"); VERIFY(document);