mirror of
https://github.com/flarum/core.git
synced 2025-07-14 13:26:23 +02: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:
@ -221,7 +221,7 @@ class Notification extends AbstractModel
|
|||||||
public static function notify(array $recipients, BlueprintInterface $blueprint)
|
public static function notify(array $recipients, BlueprintInterface $blueprint)
|
||||||
{
|
{
|
||||||
$attributes = static::getBlueprintAttributes($blueprint);
|
$attributes = static::getBlueprintAttributes($blueprint);
|
||||||
$now = Carbon::now('utc')->toDateTimeString();
|
$now = Carbon::now()->toDateTimeString();
|
||||||
|
|
||||||
static::insert(
|
static::insert(
|
||||||
array_map(function (User $user) use ($attributes, $now) {
|
array_map(function (User $user) use ($attributes, $now) {
|
||||||
|
Reference in New Issue
Block a user