Skip to content

Commit ec65a47

Browse files
Stefan-Dresslerfreekmurze
authored andcommitted
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.
1 parent 42970e1 commit ec65a47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ActivityLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function withoutLogs(Closure $callback): mixed
195195

196196
protected function replacePlaceholders(string $description, ActivityContract $activity): string
197197
{
198-
return preg_replace_callback('/:[a-z0-9._-]+/i', function ($match) use ($activity) {
198+
return preg_replace_callback('/:[a-z0-9._-]+(?<![.])/i', function ($match) use ($activity) {
199199
$match = $match[0];
200200

201201
$attribute = Str::before(Str::after($match, ':'), '.');

0 commit comments

Comments
 (0)