FIX: Correctly handle the print param on topics#show. (#16555)

The controller incorrectly sets print to true when passing `print=false`, which causes the rate limit to perform.
This commit is contained in:
Roman Rizzi
2022-04-25 16:04:13 -03:00
committed by GitHub
parent 068e93534c
commit 2a96bca7a1
3 changed files with 9 additions and 2 deletions

View File

@ -66,7 +66,7 @@ class TopicsController < ApplicationController
opts = params.slice(:username_filters, :filter, :page, :post_number, :show_deleted, :replies_to_post_number, :filter_upwards_post_id, :filter_top_level_replies)
username_filters = opts[:username_filters]
opts[:print] = true if params[:print].present?
opts[:print] = true if params[:print] == 'true'
opts[:username_filters] = username_filters.split(',') if username_filters.is_a?(String)
# Special case: a slug with a number in front should look by slug first before looking