Additional fix for #2629 with API

API object's notes fields now correctly preserve newlines.
This commit is contained in:
Geoffrey “Frogeye” Preud'homme
2019-09-22 17:36:18 +02:00
parent 5214f87003
commit f8cb5ca21c
10 changed files with 24 additions and 9 deletions

View File

@@ -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.
*