mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fix bug 66473
This commit is contained in:
@ -442,7 +442,7 @@ namespace NSNetwork
|
|||||||
std::function<void(int)> func_onProgress = nullptr;
|
std::function<void(int)> func_onProgress = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
void EscapeQuotesPS(std::wstring& command)
|
void EscapeQuotesPS(std::wstring& command, bool isPath)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
var symbols = [0x22, 0x27, 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f];
|
var symbols = [0x22, 0x27, 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f];
|
||||||
@ -456,6 +456,11 @@ namespace NSNetwork
|
|||||||
|
|
||||||
std::wstring sTmp = L" ";
|
std::wstring sTmp = L" ";
|
||||||
|
|
||||||
|
if (isPath)
|
||||||
|
{
|
||||||
|
sTmp[0] = (wchar_t)'\\'; NSStringExt::Replace(command, sTmp, L"/");
|
||||||
|
}
|
||||||
|
|
||||||
sTmp[0] = (wchar_t)0x22; NSStringExt::Replace(command, sTmp, L"%22");
|
sTmp[0] = (wchar_t)0x22; NSStringExt::Replace(command, sTmp, L"%22");
|
||||||
sTmp[0] = (wchar_t)0x27; NSStringExt::Replace(command, sTmp, L"%27");
|
sTmp[0] = (wchar_t)0x27; NSStringExt::Replace(command, sTmp, L"%27");
|
||||||
sTmp[0] = (wchar_t)0x2018; NSStringExt::Replace(command, sTmp, L"%E2%80%98");
|
sTmp[0] = (wchar_t)0x2018; NSStringExt::Replace(command, sTmp, L"%E2%80%98");
|
||||||
@ -477,8 +482,8 @@ namespace NSNetwork
|
|||||||
std::wstring sFileDst = strFileOutput;
|
std::wstring sFileDst = strFileOutput;
|
||||||
std::wstring sFileURL = sFileURLOriginal;
|
std::wstring sFileURL = sFileURLOriginal;
|
||||||
|
|
||||||
NSStringExt::Replace(sFileDst, L"\\", L"/");
|
EscapeQuotesPS(sFileDst, true);
|
||||||
EscapeQuotesPS(sFileURL);
|
EscapeQuotesPS(sFileURL, false);
|
||||||
|
|
||||||
std::wstring sApp = L"powershell.exe –c \"(new-object System.Net.WebClient).DownloadFile('" + sFileURL + L"','" + sFileDst + L"')\"";
|
std::wstring sApp = L"powershell.exe –c \"(new-object System.Net.WebClient).DownloadFile('" + sFileURL + L"','" + sFileDst + L"')\"";
|
||||||
wchar_t* pCommandLine = new wchar_t[sApp.length() + 1];
|
wchar_t* pCommandLine = new wchar_t[sApp.length() + 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user