Skip to content

Commit e32165b

Browse files
committed
Removed ability to alter per page dropdown select to bypass allowed values.
1 parent 4fb10e0 commit e32165b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1616
- Added default empty message to lang file.
1717
- [Fix people messing with sort direction from URL](https://github.com/rappasoft/laravel-livewire-tables/pull/389)
1818
- [Check to make sure column exists before sorting](https://github.com/rappasoft/laravel-livewire-tables/pull/390)
19+
- Removed ability to alter per page dropdown select to bypass allowed values.
1920

2021
## [1.10.4] - 2021-06-23
2122

src/Traits/WithPerPagePagination.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public function mountWithPerPagePagination(): void
2929

3030
public function updatedPerPage($value): void
3131
{
32+
if (! in_array($value, $this->perPageAccepted, false)) {
33+
$value = $this->perPage = $this->perPageAccepted[0] ?? 10;
34+
}
35+
3236
if (in_array(session()->get($this->getPerPagePaginationSessionKey(), $this->perPage), $this->perPageAccepted, true)) {
3337
session()->put($this->getPerPagePaginationSessionKey(), (int) $value);
3438
} else {

0 commit comments

Comments
 (0)