Fix PilotHoursAwards (#1011)

!is_int was causing the check always return false even when user enters a proper value like 6000 or 30000 in admin/award settings.

We should use !is_numeric instead to see if it is a valid numeric value.
This commit is contained in:
B.Fatih KOZ 2021-01-27 03:48:43 +03:00 committed by GitHub
parent 0d45fc287b
commit ac1d5e1555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ class PilotHoursAwards extends Award
*/ */
public function check($flight_minutes = null): bool public function check($flight_minutes = null): bool
{ {
if (!is_int($flight_minutes)) { if (!is_numeric($flight_minutes)) {
Log::error('PilotHourAwards: Flight time "'.$flight_minutes.'" is not a valid flight time'); Log::error('PilotHourAwards: Flight time "'.$flight_minutes.'" is not a valid flight time');
return false; return false;
} }