FIX: Only allow intergers for page params.

This commit is contained in:
Guo Xiang Tan
2017-10-02 10:45:54 +08:00
parent 77ea063751
commit 4e07bbfbbf
2 changed files with 14 additions and 0 deletions

View File

@@ -331,6 +331,8 @@ class ListController < ApplicationController
def build_topic_list_options
options = {}
params[:page] = params[:page].to_i rescue 1
TopicQuery.public_valid_options.each do |key|
options[key] = params[key]
end