mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 03:56:42 +00:00
Clean up API routes
This commit is contained in:
@@ -105,11 +105,11 @@ trait ConvertsDataTypes
|
||||
/**
|
||||
* Return string value.
|
||||
*/
|
||||
public function convertString(string $field): string
|
||||
public function convertString(string $field, string $default = ''): string
|
||||
{
|
||||
$entry = $this->get($field);
|
||||
if (!is_scalar($entry)) {
|
||||
return '';
|
||||
return $default;
|
||||
}
|
||||
|
||||
return (string)$this->clearString((string)$entry);
|
||||
|
Reference in New Issue
Block a user