Skip to content

Commit ee96294

Browse files
committed
Allow Model::paginate sanitize arguments
1 parent fbf9cf7 commit ee96294

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Model.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,15 @@ protected function sanitizePageNumber(int $number) : int
453453
/**
454454
* A basic function to paginate all rows of the table.
455455
*
456-
* @param int $page The current page
457-
* @param int $perPage Items per page
456+
* @param mixed $page The current page
457+
* @param mixed $perPage Items per page
458458
*
459459
* @return array<int,array<mixed>|Entity|stdClass>
460460
*/
461-
public function paginate(int $page, int $perPage = 10) : array
461+
public function paginate(mixed $page, mixed $perPage = 10) : array
462462
{
463+
$page = Pager::sanitize($page);
464+
$perPage = Pager::sanitize($perPage);
463465
$data = $this->getDatabaseToRead()
464466
->select()
465467
->from($this->getTable())

0 commit comments

Comments
 (0)