fix: notification timestamp mismatch in specific configurations (#3379)

When app's PHP server's timezone is not set to UTC, which would normally be done by Flarum's bootstrapping process, this call to Carbon would return a different timestamp to other calls elsewhere in Flarum, causing issues with notifications seemingly being delivered too early/late rather than at the actual time they were triggered.
This commit is contained in:
David Wheatley 2022-04-05 15:38:05 +01:00 committed by GitHub
parent 2541349c68
commit 9f7c5defaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ class Notification extends AbstractModel
public static function notify(array $recipients, BlueprintInterface $blueprint)
{
$attributes = static::getBlueprintAttributes($blueprint);
$now = Carbon::now('utc')->toDateTimeString();
$now = Carbon::now()->toDateTimeString();
static::insert(
array_map(function (User $user) use ($attributes, $now) {