Browse Source

Bug 1590: Backtick and dollar signs are not escaped in generated PowerShell code

https://winscp.net/tracker/1590

Source commit: 1a7667a2d1db3cb16093c1bdc1b6612725370702
Martin Prikryl 7 years ago
parent
commit
4560199397
1 changed files with 1 additions and 1 deletions
  1. 1 1
      source/core/Common.cpp

+ 1 - 1
source/core/Common.cpp

@@ -3395,7 +3395,7 @@ UnicodeString __fastcall AssemblyString(TAssemblyLanguage Language, UnicodeStrin
       break;
 
     case alPowerShell:
-      S = FORMAT(L"\"%s\"", (ReplaceStr(S, L"\"", L"`\"")));
+      S = FORMAT(L"\"%s\"", (ReplaceStr(ReplaceStr(ReplaceStr(S, L"`", L"``"), L"$", L"`$"), L"\"", L"`\"")));
       break;
 
     default: