mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for testing for float
This commit is contained in:
parent
bd24a10409
commit
f4f0290451
@ -624,7 +624,7 @@ class BaseController extends Controller
|
||||
|
||||
// 10-01-2022 need to ensure we snake case properly here to ensure permissions work as expected
|
||||
// if (auth()->user() && ! auth()->user()->hasPermission('view_'.lcfirst(class_basename($this->entity_type)))) {
|
||||
if (auth()->user() && ! auth()->user()->hasPermission('view_'.lcfirst(class_basename(Str::snake($this->entity_type))))) {
|
||||
if (auth()->user() && ! auth()->user()->hasPermission('view'.lcfirst(class_basename(Str::snake($this->entity_type))))) {
|
||||
$query->where('user_id', '=', auth()->user()->id);
|
||||
}
|
||||
|
||||
|
@ -156,8 +156,6 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
return CompanyToken::with(['cu'])->where('token', request()->header('X-API-TOKEN'))->first();
|
||||
}
|
||||
|
||||
if($truth->getCompany())
|
||||
return $this->tokens()->where('company_id', $truth->getCompany()->id)->first();
|
||||
|
||||
return $this->tokens()->first();
|
||||
}
|
||||
|
@ -212,7 +212,8 @@ trait ClientGroupSettingsSaver
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
return is_float($value) || is_numeric(strval($value));
|
||||
return !is_string($value) && (is_float($value) || is_numeric(strval($value)));
|
||||
//return is_float($value) || is_numeric(strval($value));
|
||||
case 'string':
|
||||
return ( is_string( $value ) && method_exists($value, '__toString') ) || is_null($value) || is_string($value);
|
||||
case 'bool':
|
||||
|
@ -59,7 +59,8 @@ trait CompanyGatewayFeesAndLimitsSaver
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
return is_float($value) || is_numeric(strval($value));
|
||||
return !is_string($value) && (is_float($value) || is_numeric(strval($value)));
|
||||
// return is_float($value) || is_numeric(strval($value));
|
||||
case 'string':
|
||||
return ( is_string( $value ) && method_exists($value, '__toString') ) || is_null($value) || is_string($value);
|
||||
case 'bool':
|
||||
|
@ -229,7 +229,8 @@ trait CompanySettingsSaver
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
return is_float($value) || is_numeric(strval($value));
|
||||
return !is_string($value) && (is_float($value) || is_numeric(strval($value)));
|
||||
// return is_float($value) || is_numeric(strval($value));
|
||||
case 'string':
|
||||
return (is_string($value) && method_exists($value, '__toString')) || is_null($value) || is_string($value);
|
||||
case 'bool':
|
||||
|
@ -92,7 +92,8 @@ trait SettingsSaver
|
||||
case 'real':
|
||||
case 'float':
|
||||
case 'double':
|
||||
return is_float($value) || is_numeric(strval($value));
|
||||
return !is_string($value) && (is_float($value) || is_numeric(strval($value)));
|
||||
// return is_float($value) || is_numeric(strval($value));
|
||||
case 'string':
|
||||
return !is_int($value) || ( is_string( $value ) && method_exists($value, '__toString') ) || is_null($value) || is_string($value);
|
||||
case 'bool':
|
||||
|
Loading…
x
Reference in New Issue
Block a user