mirror of
https://github.com/flarum/core.git
synced 2025-08-09 18:07:02 +02:00
Fix post policy for PHP 8 (#3145)
* Add tests to verify post policy works as intended * Fix "reply" post edit setting not working on PHP 8 Fixes #3144
This commit is contained in:
@@ -58,7 +58,7 @@ class PostPolicy extends AbstractPolicy
|
||||
|
||||
if ($allowEditing === '-1'
|
||||
|| ($allowEditing === 'reply' && $post->number >= $post->discussion->last_post_number)
|
||||
|| ($post->created_at->diffInMinutes(new Carbon) < $allowEditing)) {
|
||||
|| (is_numeric($allowEditing) && $post->created_at->diffInMinutes(new Carbon) < $allowEditing)) {
|
||||
return $this->allow();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user