fix: escape URL passed to shell.openExternal on windows (#28334)
This commit is contained in:
parent
665ac6f9c8
commit
94af0e8bb0
1 changed files with 4 additions and 1 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include "base/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
#include "content/public/browser/browser_task_traits.h"
|
#include "content/public/browser/browser_task_traits.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
|
#include "net/base/escape.h"
|
||||||
#include "shell/common/electron_paths.h"
|
#include "shell/common/electron_paths.h"
|
||||||
#include "ui/base/win/shell.h"
|
#include "ui/base/win/shell.h"
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
@ -241,7 +242,9 @@ std::string OpenExternalOnWorkerThread(
|
||||||
// Quote the input scheme to be sure that the command does not have
|
// Quote the input scheme to be sure that the command does not have
|
||||||
// parameters unexpected by the external program. This url should already
|
// parameters unexpected by the external program. This url should already
|
||||||
// have been escaped.
|
// have been escaped.
|
||||||
base::string16 escaped_url = L"\"" + base::UTF8ToUTF16(url.spec()) + L"\"";
|
base::string16 escaped_url =
|
||||||
|
L"\"" + base::UTF8ToUTF16(net::EscapeExternalHandlerValue(url.spec())) +
|
||||||
|
L"\"";
|
||||||
base::string16 working_dir = options.working_dir.value();
|
base::string16 working_dir = options.working_dir.value();
|
||||||
|
|
||||||
if (reinterpret_cast<ULONG_PTR>(
|
if (reinterpret_cast<ULONG_PTR>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue