[bitcoin/bitcoin] wallet: Replace %w by wallet name in -walletnotify script (#13339)

laanwj commented on this pull request.

> @@ -988,6 +988,9 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
if (!strCmd.empty())
boost::replace_all(strCmd, «%s», wtxIn.GetHash().GetHex());
+ std::string name = GetName();
+ boost::replace_all(name, «‘», «»'»);

Please factor this out to a function `ShellEscape` which does `boost::replace_all(name, «‘», «»'»);; return «‘» + name + «‘»`. We might need that in other places at some point, and it makes it an easier to review unit.
(also it’s possible that for WIN32/cmd this needs something else?)

Добавить комментарий