Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-02-19 15:52:45 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-02-20 21:49:11 +0300
commit6063d010f778ba7bf81d720e00e09aac5ca25750 (patch)
tree9a8cfa626b81f76a8e1eaa7a9ffbc271b790467c /lib
parentdaa3e5a1d6edb60205d9206e2d6c0bfc57cf6598 (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.php6
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);