FIX: if badges are disabled badge pages should 404

This commit is contained in:
Sam 2016-03-29 17:21:32 +11:00
parent adbc22530c
commit ed750cac39
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,8 @@ class BadgesController < ApplicationController
skip_before_filter :check_xhr, only: [:index, :show]
def index
raise Discourse::NotFound unless SiteSetting.enable_badges
badges = Badge.all
if (params[:only_listable] == "true") || !request.xhr?
@ -28,6 +30,8 @@ class BadgesController < ApplicationController
end
def show
raise Discourse::NotFound unless SiteSetting.enable_badges
params.require(:id)
badge = Badge.enabled.find(params[:id])