Commit e0a33d04 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't pass hash part of URI to EvaluateNewWindow.

parent 986f4cb9
......@@ -116,4 +116,6 @@ void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISuppo
IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN;
HRESULT bind_mon_to_wstr(HTMLInnerWindow*,IMoniker*,WCHAR**) DECLSPEC_HIDDEN;
......@@ -857,13 +857,14 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
HTMLOuterWindow *window = This->outer_window;
INewWindowManager *new_window_mgr;
BSTR uri_str;
IUri *uri;
HRESULT hres;
TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
debugstr_w(features), replace, pomWindowResult);
if(!window->doc_obj)
if(!window->doc_obj || !window->uri_nofrag)
return E_UNEXPECTED;
if(name && *name == '_') {
......@@ -878,10 +879,14 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
return E_NOTIMPL;
}
hres = INewWindowManager_EvaluateNewWindow(new_window_mgr, url, name, window->url,
features, !!replace, window->doc_obj->has_popup ? 0 : NWMF_FIRST, 0);
hres = IUri_GetDisplayUri(window->uri_nofrag, &uri_str);
if(SUCCEEDED(hres)) {
hres = INewWindowManager_EvaluateNewWindow(new_window_mgr, url, name, uri_str,
features, !!replace, window->doc_obj->has_popup ? 0 : NWMF_FIRST, 0);
window->doc_obj->has_popup = TRUE;
SysFreeString(uri_str);
}
INewWindowManager_Release(new_window_mgr);
window->doc_obj->has_popup = TRUE;
if(FAILED(hres)) {
*pomWindowResult = NULL;
return S_OK;
......
......@@ -372,6 +372,7 @@ struct HTMLOuterWindow {
HTMLInnerWindow *pending_window;
IMoniker *mon;
IUri *uri;
IUri *uri_nofrag;
BSTR url;
SCRIPTMODE scriptmode;
......
......@@ -94,7 +94,7 @@ IUri *nsuri_get_uri(nsWineURI *nsuri)
return nsuri->uri;
}
static IUri *get_uri_nofrag(IUri *uri)
IUri *get_uri_nofrag(IUri *uri)
{
IUriBuilder *uri_builder;
IUri *ret;
......
......@@ -106,6 +106,11 @@ void set_current_uri(HTMLOuterWindow *window, IUri *uri)
window->uri = NULL;
}
if(window->uri_nofrag) {
IUri_Release(window->uri_nofrag);
window->uri_nofrag = NULL;
}
SysFreeString(window->url);
window->url = NULL;
......@@ -115,6 +120,13 @@ void set_current_uri(HTMLOuterWindow *window, IUri *uri)
IUri_AddRef(uri);
window->uri = uri;
window->uri_nofrag = get_uri_nofrag(uri);
if(!window->uri_nofrag) {
FIXME("get_uri_nofrag failed\n");
IUri_AddRef(uri);
window->uri_nofrag = uri;
}
IUri_GetDisplayUri(uri, &window->url);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment