Merge pull request #587 from mark-rushakoff/fix-symbol-leak

Don't call to_sym on param
This commit is contained in:
Sam 2013-03-28 23:06:10 -07:00
commit 621c89d396
1 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class EducationController < ApplicationController
def show
raise Discourse::InvalidAccess.new unless params[:id] =~ /^[a-z0-9\-\_]+$/
raise Discourse::NotFound.new unless I18n.t(:education).include?(params[:id].to_sym)
raise Discourse::NotFound.new if I18n.t("education.#{params[:id]}", default: MISSING_KEY) == MISSING_KEY
education_posts_text = I18n.t('education.until_posts', count: SiteSetting.educate_until_posts)
@ -14,4 +14,7 @@ class EducationController < ApplicationController
render text: PrettyText.cook(markdown_content)
end
private
MISSING_KEY = '_MISSING_KEY_'.freeze
end