Skip to content

Commit

Permalink
FIX: if badges are disabled badge pages should 404
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Mar 29, 2016
1 parent adbc225 commit ed750ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/badges_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -28,6 +30,8 @@ def index
end

def show
raise Discourse::NotFound unless SiteSetting.enable_badges

params.require(:id)
badge = Badge.enabled.find(params[:id])

Expand Down

0 comments on commit ed750ca

Please sign in to comment.