Revert all recent changes to wxHtmlWinParser::OpenURL()
The changes of7e8c2cc4a5
broke opening URLs of the form "file:///full/path/file.zip#zip:file.htm#anchor" as the one used as the initial page in the help sample, which showed the error about not being able to open it because OpenURL() now turned such URL into a partially escaped one by replacing the last "#" with "%23" and preventing wxArchiveFSHandler from handling it properly. There seem to be too many problems with changing this code, so revert the commit above and the commit5c72e0c354
which already corrected another problem with it. See #17148.
This commit is contained in:
@@ -293,7 +293,7 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
|
||||
|
||||
// consider url as absolute path first
|
||||
wxURI current(myurl);
|
||||
myfullurl = current.BuildURI();
|
||||
myfullurl = current.BuildUnescapedURI();
|
||||
|
||||
// if not absolute then ...
|
||||
if( current.IsRelative() )
|
||||
@@ -306,7 +306,7 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
|
||||
{
|
||||
wxURI path(myfullurl);
|
||||
path.Resolve( base );
|
||||
myfullurl = path.BuildURI();
|
||||
myfullurl = path.BuildUnescapedURI();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -315,23 +315,15 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
|
||||
{
|
||||
basepath += myurl;
|
||||
wxURI connected( basepath );
|
||||
myfullurl = connected.BuildURI();
|
||||
myfullurl = connected.BuildUnescapedURI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxString redirect;
|
||||
status = m_windowInterface->OnHTMLOpeningURL
|
||||
(
|
||||
type,
|
||||
wxURI::Unescape(myfullurl),
|
||||
&redirect
|
||||
);
|
||||
status = m_windowInterface->OnHTMLOpeningURL(type, myfullurl, &redirect);
|
||||
if ( status != wxHTML_REDIRECT )
|
||||
{
|
||||
myurl = myfullurl;
|
||||
break;
|
||||
}
|
||||
|
||||
myurl = redirect;
|
||||
}
|
||||
|
Reference in New Issue
Block a user