Compare commits

..

7 Commits

Author SHA1 Message Date
github-actions[bot]
cbf7aef0c1 Merge pull request #11048 from firefly-iii/release-1760157167
🤖 Automatically merge the PR into the develop branch.
2025-10-11 06:33:00 +02:00
JC5
8c3e6c0189 🤖 Auto commit for release 'develop' on 2025-10-11 2025-10-11 06:32:47 +02:00
James Cole
cf7ee79c1c Fix two bugs in requests. 2025-10-11 06:27:55 +02:00
github-actions[bot]
7e344e4332 Merge pull request #11047 from firefly-iii/release-1760124177
🤖 Automatically merge the PR into the develop branch.
2025-10-10 21:23:04 +02:00
JC5
0a55e9fb4e 🤖 Auto commit for release 'develop' on 2025-10-10 2025-10-10 21:22:57 +02:00
James Cole
ed2e0e86dc Don't validate on empty string. 2025-10-10 20:54:51 +02:00
James Cole
9d1fb2cd6a Make sure that null|string passed is always a string 2025-10-10 20:54:31 +02:00
5 changed files with 13 additions and 5 deletions

View File

@@ -30,8 +30,8 @@ class DateRangeRequest extends ApiRequest
public function rules(): array
{
return [
'start' => sprintf('date|after:1970-01-02|before:2038-01-17|before:end|required_with:end|', $this->required),
'end' => sprintf('date|after:1970-01-02|before:2038-01-17|after:start|required_with:start|', $this->required),
'start' => sprintf('date|after:1970-01-02|before:2038-01-17|before:end|required_with:end|%s', $this->required),
'end' => sprintf('date|after:1970-01-02|before:2038-01-17|after:start|required_with:start|%s', $this->required),
];
}
@@ -39,6 +39,8 @@ class DateRangeRequest extends ApiRequest
{
$validator->after(
function (Validator $validator): void {
$this->attributes->set('start', null);
$this->attributes->set('end', null);
if (!$validator->valid()) {
return;
}

View File

@@ -38,6 +38,7 @@ class DateRequest extends ApiRequest
{
$validator->after(
function (Validator $validator): void {
$this->attributes->set('date', null);
if (!$validator->valid()) {
return;
}

View File

@@ -47,7 +47,7 @@ class PaginationRequest extends ApiRequest
public function rules(): array
{
return [
'sort' => ['nullable', new IsValidSortInstruction($this->sortClass)],
'sort' => ['nullable', new IsValidSortInstruction((string)$this->sortClass)],
'limit' => 'numeric|min:1|max:131337',
'page' => 'numeric|min:1|max:131337',
];

View File

@@ -38,6 +38,11 @@ class IsValidSortInstruction implements ValidationRule
return;
}
if ('' === $value) {
// don't validate.
return;
}
$validParameters = config(sprintf('firefly.allowed_sort_parameters.%s', $shortClass));
if (!is_array($validParameters)) {
$fail('validation.no_sort_instructions')->translate(['object' => $shortClass]);

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2025-10-10',
'build_time' => 1760116211,
'version' => 'develop/2025-10-11',
'build_time' => 1760157052,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.