Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"?page=false" is not a number. Add a configuration to skip the error and to convert it as 0, or 1 or something #626

Closed
thebravoman opened this issue May 7, 2021 · 1 comment

Comments

@thebravoman
Copy link

In this platform we get lot of calls like

?page=false

or

?page=2%27A=0

We can't do much about these calls. A lot of automated scripts, tools and bots just love our platform.

We have exception_notifier install so every time there is an error we get an email. Which is a lot of emails.

My recommendation is - don't throw and error when the page is not a number, but instead return 1.
I have about 200 controllers and adding params[:page].try(:to_i), or some other logic to each of them means supporting all of them.
To support current behavior a configuration could be added

WillPaginate.default_pagenum =1

If it is set it will not throw and error but at least take page=1 when the ?page is not a number

Would such a PR be accepted?

@mislav
Copy link
Owner

mislav commented May 9, 2021

Thanks for writing in! Duplicate of #271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants