From ec65a478a909b8df1b4f0c3c45de2592ca7639e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Dre=C3=9Fler?= <34586437+Stefan-Dressler@users.noreply.github.com> Date: Tue, 17 Jan 2023 16:36:54 +0100 Subject: [PATCH] Fix for replacePlaceholders with ending dot I noticed that placeholders at the end of a sentence are not matching. ':causer.name has updated :properties.updatedFields.' Removing the last dot works, but is not always nice. I would suggest changing the regex a little. --- src/ActivityLogger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ActivityLogger.php b/src/ActivityLogger.php index 464862e1..0b93f1d3 100644 --- a/src/ActivityLogger.php +++ b/src/ActivityLogger.php @@ -195,7 +195,7 @@ public function withoutLogs(Closure $callback): mixed protected function replacePlaceholders(string $description, ActivityContract $activity): string { - return preg_replace_callback('/:[a-z0-9._-]+/i', function ($match) use ($activity) { + return preg_replace_callback('/:[a-z0-9._-]+(?