diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index a11c636eab27..02cacc8e15fc 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -49,7 +49,7 @@ class Helpers * * @return null|string */ - public function formatCustomFieldValue($custom_fields = null, $field, $value, Client $client = null): ?string + public function formatCustomFieldValue($custom_fields, $field, $value, Client $client = null): ?string { $custom_field = ''; @@ -84,7 +84,7 @@ class Helpers * * @return string */ - public function makeCustomField($custom_fields = null, $field): string + public function makeCustomField($custom_fields, $field): string { if ($custom_fields && property_exists($custom_fields, $field)) { $custom_field = $custom_fields->{$field}; diff --git a/app/Utils/Traits/CompanySettingsSaver.php b/app/Utils/Traits/CompanySettingsSaver.php index db77940563a1..b51245faacea 100644 --- a/app/Utils/Traits/CompanySettingsSaver.php +++ b/app/Utils/Traits/CompanySettingsSaver.php @@ -217,13 +217,17 @@ trait CompanySettingsSaver switch ($key) { case 'int': case 'integer': - return ctype_digit(strval(abs($value))); + if(is_string($value)) + return false; + + return is_int($value) || ctype_digit(strval(abs($value))); case 'real': case 'float': case 'double': return is_float($value) || is_numeric(strval($value)); case 'string': - return method_exists($value, '__toString') || is_null($value) || is_string($value); + // return method_exists($value, '__toString') || is_null($value) || is_string($value); + return is_null($value) || is_string($value); case 'bool': case 'boolean': return is_bool($value) || (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);