mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Additional fix for #2629 with API
API object's notes fields now correctly preserve newlines.
This commit is contained in:
@@ -237,6 +237,21 @@ class Request extends FormRequest
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return string value, but keep newlines, or NULL if empty.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function nullableNlString(string $field): string
|
||||
{
|
||||
if (!$this->has($field)) {
|
||||
return null;
|
||||
}
|
||||
return app('steam')->nlCleanString((string)($this->get($field) ?? ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and clean a string.
|
||||
*
|
||||
|
Reference in New Issue
Block a user