Skip to content

Commit a799807

Browse files
ppaulisweierophinney
authored andcommitted
#75 fixed broken validation of page_size parameter
Signed-off-by: Pascal Paulis <[email protected]>
1 parent 98513d4 commit a799807

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/InputFilter/RestService/PatchInputFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function init()
7575
'continue_if_empty' => true,
7676
'validators' => [
7777
new CallbackValidator(function ($value) {
78-
if (is_numeric($value) && intval($value) !== $value) {
78+
if (!is_numeric($value) || intval($value) != $value) {
7979
return false;
8080
}
8181

test/InputFilter/RestService/PatchInputFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function dataProviderIsValidTrue(): array
5555
],
5656
'entity_identifier_name' => 'id',
5757
'hydrator_name' => ArraySerializableHydrator::class,
58-
'page_size' => 25,
58+
'page_size' => "25",
5959
'page_size_param' => null,
6060
'resource_class' => 'Foo_Bar\\V1\\Rest\\Baz_Bat\\Baz_BatResource',
6161
'route_identifier_name' => 'foo_bar_id',

0 commit comments

Comments
 (0)