From 8336a77fe669cee0f04d5fac98c3afae0ca58446 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Mar 2016 21:54:53 +0100 Subject: [PATCH] Revert all recent changes to wxHtmlWinParser::OpenURL() The changes of 7e8c2cc4a5e80cc4ff8e55a3eb4ade4d6e5b0a11 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 commit 5c72e0c354cd4e348da5c6c39475c7185e13c6be which already corrected another problem with it. See #17148. --- src/html/winpars.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index b085fdce4d..edc8ffe0f3 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -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; }