diff options
Diffstat (limited to 'backends/networking/sdl_net/uploadfileclienthandler.cpp')
-rw-r--r-- | backends/networking/sdl_net/uploadfileclienthandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backends/networking/sdl_net/uploadfileclienthandler.cpp b/backends/networking/sdl_net/uploadfileclienthandler.cpp index 8486b6e92e..fb00b6bf5e 100644 --- a/backends/networking/sdl_net/uploadfileclienthandler.cpp +++ b/backends/networking/sdl_net/uploadfileclienthandler.cpp @@ -66,7 +66,7 @@ void UploadFileClientHandler::handle(Client *client) { // fail on suspicious headers if (_headersStream->size() > Reader::SUSPICIOUS_HEADERS_SIZE) { - setErrorMessageHandler(*client, _("Invalid request: headers are too long!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid request: headers are too long!"))); } break; @@ -108,7 +108,7 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { // fail on suspicious headers if (_headersStream->size() > Reader::SUSPICIOUS_HEADERS_SIZE) { - setErrorMessageHandler(*client, _("Invalid request: headers are too long!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid request: headers are too long!"))); } // search for "upload_file" field @@ -134,11 +134,11 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { path += '/'; AbstractFSNode *originalNode = g_system->getFilesystemFactory()->makeFileNodePath(path + filename); if (!HandlerUtils::permittedPath(originalNode->getPath())) { - setErrorMessageHandler(*client, _("Invalid path!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid path!"))); return; } if (originalNode->exists()) { - setErrorMessageHandler(*client, _("There is a file with that name in the parent directory!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("There is a file with that name in the parent directory!"))); return; } @@ -152,7 +152,7 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { Common::DumpFile *f = new Common::DumpFile(); if (!f->open(originalNode->getPath(), true)) { delete f; - setErrorMessageHandler(*client, _("Failed to upload the file!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Failed to upload the file!"))); return; } @@ -181,7 +181,7 @@ void UploadFileClientHandler::handleBlockContent(Client *client) { if (client->noMoreContent()) { // if no file field was found - failure if (_uploadedFiles == 0) { - setErrorMessageHandler(*client, _("No file was passed!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("No file was passed!"))); } else { setSuccessHandler(*client); } @@ -199,9 +199,9 @@ void UploadFileClientHandler::setSuccessHandler(Client &client) { client, Common::String::format( "%s<br/><a href=\"files?path=%s\">%s</a>", - _("Uploaded successfully!"), + HandlerUtils::toUtf8(_("Uploaded successfully!")).c_str(), client.queryParameter("path").c_str(), - _("Back to parent directory") + HandlerUtils::toUtf8(_("Back to parent directory")).c_str() ), (client.queryParameter("ajax") == "true" ? "/filesAJAX?path=" : "/files?path=") + LocalWebserver::urlEncodeQueryParameterValue(client.queryParameter("path")) |