mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix #2628
This commit is contained in:
@@ -56,7 +56,7 @@ class BillFormRequest extends Request
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'notes' => $this->string('notes'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'active' => $this->boolean('active'),
|
||||
];
|
||||
}
|
||||
|
@@ -224,6 +224,19 @@ class Request extends FormRequest
|
||||
return app('steam')->cleanString((string)($this->get($field) ?? ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string value, but keep newlines.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function nlString(string $field): string
|
||||
{
|
||||
return app('steam')->nlCleanString((string)($this->get($field) ?? ''));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse and clean a string.
|
||||
*
|
||||
@@ -242,6 +255,24 @@ class Request extends FormRequest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and clean a string, but keep the newlines.
|
||||
*
|
||||
* @param string|null $string
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function nlStringFromValue(?string $string): ?string
|
||||
{
|
||||
if (null === $string) {
|
||||
return null;
|
||||
}
|
||||
$result = app('steam')->nlCleanString($string);
|
||||
|
||||
return '' === $result ? null : $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return date or NULL.
|
||||
*
|
||||
|
@@ -53,7 +53,7 @@ class RuleFormRequest extends Request
|
||||
'rule_group_id' => $this->integer('rule_group_id'),
|
||||
'active' => $this->boolean('active'),
|
||||
'trigger' => $this->string('trigger'),
|
||||
'description' => $this->string('description'),
|
||||
'description' => $this->nlString('description'),
|
||||
'stop_processing' => $this->boolean('stop_processing'),
|
||||
'strict' => $this->boolean('strict'),
|
||||
'triggers' => $this->getRuleTriggerData(),
|
||||
|
@@ -55,7 +55,7 @@ class RuleGroupFormRequest extends Request
|
||||
|
||||
return [
|
||||
'title' => $this->string('title'),
|
||||
'description' => $this->string('description'),
|
||||
'description' => $this->nlString('description'),
|
||||
'active' => $active,
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user