diff options
author | Joas Schilling <coding@schilljs.com> | 2021-02-19 15:52:45 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-02-20 21:49:11 +0300 |
commit | 6063d010f778ba7bf81d720e00e09aac5ca25750 (patch) | |
tree | 9a8cfa626b81f76a8e1eaa7a9ffbc271b790467c /lib | |
parent | daa3e5a1d6edb60205d9206e2d6c0bfc57cf6598 (diff) |
Replace all message parameters and not only the last one
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Search/MessageSearch.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Search/MessageSearch.php b/lib/Search/MessageSearch.php index 84b727a97..646e394fd 100644 --- a/lib/Search/MessageSearch.php +++ b/lib/Search/MessageSearch.php @@ -172,11 +172,11 @@ class MessageSearch implements IProvider { $messageStr = $message->getMessage(); $search = $replace = []; foreach ($message->getMessageParameters() as $key => $parameter) { - $search = '{' . $key . '}'; + $search[] = '{' . $key . '}'; if ($parameter['type'] === 'user') { - $replace = '@' . $parameter['name']; + $replace[] = '@' . $parameter['name']; } else { - $replace = $parameter['name']; + $replace[] = $parameter['name']; } } $messageStr = str_replace($search, $replace, $messageStr); |