mirror of
https://github.com/flarum/framework.git
synced 2025-02-20 22:58:26 +08:00
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:
parent
2541349c68
commit
9f7c5defaa
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user