yajra / laravel-datatables

jQuery DataTables API for Laravel
https://yajrabox.com/docs/laravel-datatables
MIT License
4.76k stars 858 forks source link

Set maximum records limit per-page in config. #3171

Open gemul opened 2 months ago

gemul commented 2 months ago

This PR adds a max_limit configuration to prevent end-users from arbitrarily setting a large value for the length request parameter, which could otherwise cause the server to overload if not handled manually (e.g., in middleware).

If the length value exceeds this limit, it will be overridden with the specified max_limit.

The default value is 100.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

yajra commented 2 months ago

Thanks for the PR! The changes look good, however, I suspect this might break the export functionality of buttons package.

Will check further when I get the chance.