mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-07 11:40:56 -05:00
refactor: count on null
This commit is contained in:
@@ -485,7 +485,7 @@ class CommentController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
$selected = mt_rand(0, count($thankArray) - 1);
|
||||
$selected = mt_rand(0, (is_countable($thankArray) ? count($thankArray) : 0) - 1);
|
||||
$comment->content = $thankArray[$selected];
|
||||
$comment->user_id = $user->id;
|
||||
$comment->torrent_id = $torrent->id;
|
||||
|
||||
Reference in New Issue
Block a user