gecko-dev/uriloader
Toshihito Kikuchi d5a7d77f4f Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz
For launching with an external protocol handler on Windows, we validate a uri
before sending it to `ShellExecute`, by converting a string into `PIDL` using
`SHParseDisplayName` and extract a string back from PIDL using
`IShellFolder::GetDisplayNameOf`.  The problem was that if a fragment, a
string following a hash mark (#), is always dropped after this validation.
This is caused by the intended design of Windows.

A proposed fix is to use `CreateUri` for validation, which is used behind
`IShellFolder::GetDisplayNameOf`.  However, we also keep `SHParseDisplayName`
because there are cases where `CreateUri` succeeds while `SHParseDisplayName`
fails such as a non-existent `file:` uri and we want to keep the same
validation result for those cases.

Adding `CreateUri` broke MinGW build because of our toolkit issue.  We use
dynamic linking for MinGW build in the meantime.

This patch adds a new unittest to make sure the new validation logic
behaves the same as the old one except the fragment issue.

Differential Revision: https://phabricator.services.mozilla.com/D42041

--HG--
extra : moz-landing-system : lando
2019-08-19 22:10:32 +00:00
..
base Bug 1562292: Part 2d - Operate on BrowsingContext in most of OpenWindowInternal. r=nika 2019-08-01 17:08:54 -07:00
exthandler Bug 1573051 - Use both SHParseDisplayName and CreateUri to validate a uri. r=aklotz 2019-08-19 22:10:32 +00:00
prefetch Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-08-13 07:15:25 +00:00
moz.build