mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
util: make ReplaceAll literal
`ReplaceAll()` substitutes fixed tokens in notification commands and other strings. PR #25803 replaced the Boost helper with `std::regex_replace()`, treating searches as regular expressions and substitutes as replacement-format syntax. Restore literal, non-recursive replacement so callers match fixed tokens and preserve replacement bytes exactly, while avoiding a new string when the search text is absent. Co-authored-by: Rob Hamilton <6456095+Rob1Ham@users.noreply.github.com>
This commit is contained in:
@@ -186,8 +186,8 @@ class NotificationsTest(BitcoinTestFramework):
|
||||
self.sync_mempools()
|
||||
notify_path = os.path.join(self.walletnotify_dir, notify_outputname(wallet_name, txid))
|
||||
self.wait_until(lambda: os.path.exists(command_marker) or os.path.exists(notify_path), timeout=10)
|
||||
assert os.path.exists(command_marker) # TODO: Wallet names must not inject shell commands.
|
||||
assert not os.path.exists(notify_path) # TODO: Wallet names must remain literal in notification paths.
|
||||
assert not os.path.exists(command_marker)
|
||||
assert os.path.exists(notify_path)
|
||||
|
||||
self.log.info("test -alertnotify with large work invalid chain")
|
||||
# create a bunch of invalid blocks
|
||||
|
||||
Reference in New Issue
Block a user