mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 22:35:03 +08:00
FIX: Validate page/limit params for directory, user-badges and groups (#22877)
We'll now return a 400 error instead of 500. 400 is a better description of the issue, and also avoids creating unnecessary noise in the logs.
This commit is contained in:
@ -88,7 +88,7 @@ class GroupsController < ApplicationController
|
||||
# count the total before doing pagination
|
||||
total = groups.count
|
||||
|
||||
page = params[:page].to_i
|
||||
page = fetch_int_from_params(:page, default: 0)
|
||||
page_size = MobileDetection.mobile_device?(request.user_agent) ? 15 : 36
|
||||
groups = groups.offset(page * page_size).limit(page_size)
|
||||
|
||||
|
Reference in New Issue
Block a user