summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2023-05-11 22:05:17 +0200
committerMattes D <github@xoft.cz>2023-05-16 23:50:37 +0200
commitc9522fb740200ccef6230cec452c48efb31e5394 (patch)
tree7e74d70699e13dd0a92444a1a0add7a3059ac7ca /src/WebAdmin.cpp
parentTry a timeout for jobs. (diff)
downloadcuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.gz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.bz2
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.lz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.xz
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.zst
cuberite-c9522fb740200ccef6230cec452c48efb31e5394.zip
Diffstat (limited to 'src/WebAdmin.cpp')
-rw-r--r--src/WebAdmin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index a96472b04..39b935fbd 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -378,7 +378,7 @@ void cWebAdmin::HandleFileRequest(cHTTPServerConnection & a_Connection, cHTTPInc
// Read the file contents and guess its mime-type, based on the extension:
AString Content = "<h2>404 Not Found</h2>";
AString ContentType = "text/html";
- AString Path = Printf("webadmin/files/%s", FileURL.c_str());
+ AString Path = "webadmin/files/" + FileURL;
// Return 404 if the file is not found, or the URL contains '../' (for security reasons)
if ((FileURL.find("../") == AString::npos) && cFile::IsFile(Path))
@@ -485,9 +485,9 @@ sWebAdminPage cWebAdmin::GetPage(const HTTPRequest & a_Request)
page.ContentType = "text/html"; // Default to HTML content type, unless overridden by a plugin
if (!tab->m_Callback->Call(a_Request, split[1], page.Content, page.ContentType))
{
- page.Content = GetHTMLEscapedString(Printf(
- "WebTab callback for plugin %s, page %s has failed.",
- tab->m_PluginName.c_str(), tab->m_Title.c_str()
+ page.Content = GetHTMLEscapedString(fmt::format(
+ FMT_STRING("WebTab callback for plugin {}, page {} has failed."),
+ tab->m_PluginName, tab->m_Title
));
}
page.PluginName = tab->m_PluginName;