Only do time comparison if setting is numeric

This commit is contained in:
Toby Zerner 2018-07-21 18:44:44 +09:30
parent 2dd8514d62
commit 607132a68f

View File

@ -125,7 +125,7 @@ class DiscussionPolicy extends AbstractPolicy
if ($allowEditTags === '-1'
|| ($allowEditTags === 'reply' && $discussion->participants_count <= 1)
|| ($discussion->start_time->diffInMinutes(new Carbon) < $allowEditTags)
|| (is_numeric($allowEditTags) && $discussion->start_time->diffInMinutes(new Carbon) < $allowEditTags)
) {
return true;
}