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

Crash with non integer page #425

Closed
brauliobo opened this issue Dec 7, 2014 · 3 comments
Closed

Crash with non integer page #425

brauliobo opened this issue Dec 7, 2014 · 3 comments

Comments

@brauliobo
Copy link

  invalid value for Integer(): "3index.php"
  vendor/plugins/will_paginate/lib/will_paginate/page_number.rb:16:in `initialize'
@mislav
Copy link
Owner

mislav commented Dec 13, 2014

The exception is deliberate since "3index.php" is an invalid page number. Your site seems to be probed by a bot that's generating invalid requests. will_paginate configures Rails in production to serve 404 pages for these exceptions. You can also rescue WillPaginate::InvalidPage in your controllers to define your own handling, like ignoring them.

@mislav mislav closed this as completed Dec 13, 2014
@brauliobo
Copy link
Author

@mislav thanks, I'll treat the exceptions.

huacnlee added a commit to ruby-china/homeland that referenced this issue Feb 14, 2017
@dignoe
Copy link

dignoe commented May 31, 2019

Hey @mislav, I'm still seeing these errors coming through via Rollbar. You mentioned above that will_paginate should throw a WillPaginate::InvalidPage error, but I'm not seeing that. I'm getting ArgumentError: invalid value for Integer(): "10(('.,." for the URL https://www.cardgnome.com/blog?page=10((%27.,.. This seems to be happening for any page param that begins with a number but isn't a valid integer (e.g. 10((%27.,., 2%22, 2212.1, etc.). These are all coming from probing bots, and I'd like them to just be handled as 404s.

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

3 participants