X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/81915974f6986634d17833ae69106091b9562a06..6dc6fda69441fa0ae3204a1a818224626b7cc1c1:/src/common/fs_inet.cpp diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 4a06c7c460..8d295d4677 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -82,7 +82,17 @@ bool wxInternetFSHandler::CanOpen(const wxString& location) wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) { - wxString right = GetProtocol(location) + wxT(":") + GetRightLocation(location); + wxString myloc(GetRightLocation(location)); + + // fix malformed url: + if (myloc.Left(2) != wxT("//")) + { + if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc; + else myloc = wxT("/") + myloc; + } + if (myloc.Mid(2).Find(wxT('/')) == wxNOT_FOUND) myloc << wxT('/'); + + wxString right = GetProtocol(location) + wxT(":") + myloc; wxInputStream *s; wxString content; wxInetCacheNode *info; @@ -126,7 +136,8 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri return new wxFSFile(s, right, info->GetMime(), - GetAnchor(location)); + GetAnchor(location), + wxDateTime::Today()); } else return (wxFSFile*) NULL; }