mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-29 11:51:24 +00:00
Encode the Login Error Page URL and Cover More Windows Path Forms
The login dialog's error page was still loaded from a raw resources path; it now uses file_url_from_path like the other local pages. The Windows file URL tests now also cover a resources path joined with a forward-slash relative path, as the callers build them, and a UNC path.
This commit is contained in:
@@ -599,7 +599,7 @@ void ZUserLogin::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt))
|
||||
|
||||
bool ZUserLogin::ShowErrorPage()
|
||||
{
|
||||
wxString ErrortUrl = from_u8((boost::filesystem::path(resources_dir()) / "web\\login\\error.html").make_preferred().string());
|
||||
wxString ErrortUrl = file_url_from_path(boost::filesystem::path(resources_dir()) / "web/login/error.html");
|
||||
load_url(ErrortUrl);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -54,6 +54,11 @@ TEST_CASE("A file URL of a Windows path has a drive letter and forward slashes",
|
||||
"file:///D:/%23OneDrive/OrcaSlicer/resources/web/guide/0/index.html" },
|
||||
{ L"D:\\100%\\OrcaSlicer\\resources\\web\\homepage\\index.html",
|
||||
"file:///D:/100%25/OrcaSlicer/resources/web/homepage/index.html" },
|
||||
// Callers join the resources directory with a forward-slash relative path.
|
||||
{ L"D:\\#OneDrive\\OrcaSlicer\\resources/web/homepage/index.html",
|
||||
"file:///D:/%23OneDrive/OrcaSlicer/resources/web/homepage/index.html" },
|
||||
{ L"\\\\server\\share\\OrcaSlicer\\resources\\web\\homepage\\index.html",
|
||||
"file://server/share/OrcaSlicer/resources/web/homepage/index.html" },
|
||||
}));
|
||||
CHECK(file_url_from_path(boost::filesystem::path(path)).utf8_string() == url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user