mshtml: Strip hash part before combining URIs.

This commit is contained in:
Jacek Caban 2013-11-29 12:58:25 +01:00 committed by Alexandre Julliard
parent 323bec99b3
commit 8c6d9482bc
1 changed files with 20 additions and 8 deletions

View File

@ -141,6 +141,23 @@ static BOOL compare_ignoring_frag(IUri *uri1, IUri *uri2)
return ret;
}
static HRESULT combine_url(IUri *base_uri, const WCHAR *rel_url, IUri **ret)
{
IUri *uri_nofrag;
HRESULT hres;
uri_nofrag = get_uri_nofrag(base_uri);
if(!uri_nofrag)
return E_FAIL;
hres = CoInternetCombineUrlEx(uri_nofrag, rel_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
ret, 0);
IUri_Release(uri_nofrag);
if(FAILED(hres))
WARN("CoInternetCombineUrlEx failed: %08x\n", hres);
return hres;
}
static nsresult create_nsuri(IUri*,HTMLOuterWindow*,NSContainer*,const char*,nsWineURI**);
static const char *debugstr_nsacstr(const nsACString *nsstr)
@ -2407,12 +2424,10 @@ static nsresult NSAPI nsURI_Resolve(nsIFileURL *iface, const nsACString *aRelati
if(!path)
return NS_ERROR_OUT_OF_MEMORY;
hres = CoInternetCombineUrlEx(This->uri, path, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, &new_uri, 0);
hres = combine_url(This->uri, path, &new_uri);
heap_free(path);
if(FAILED(hres)) {
ERR("CoIntenetCombineUrlEx failed: %08x\n", hres);
if(FAILED(hres))
return NS_ERROR_FAILURE;
}
hres = IUri_GetDisplayUri(new_uri, &ret);
IUri_Release(new_uri);
@ -3317,10 +3332,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
MultiByteToWideChar(CP_ACP, 0, spec, -1, new_spec, sizeof(new_spec)/sizeof(WCHAR));
if(base_wine_uri) {
hres = CoInternetCombineUrlEx(base_wine_uri->uri, new_spec, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
&urlmon_uri, 0);
if(FAILED(hres))
WARN("CoInternetCombineUrlEx failed: %08x\n", hres);
hres = combine_url(base_wine_uri->uri, new_spec, &urlmon_uri);
}else {
hres = create_uri(new_spec, 0, &urlmon_uri);
if(FAILED(hres))