mislav/will_paginate

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

thebravoman opened this issue · 1 comments

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?

Thanks for writing in! Duplicate of #271