Don't call to_sym on param
This commit is contained in:
parent
cb6b9ccc6d
commit
3e3712a517
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue