Fix error 500 when passing an invalid `lang` parameter (#33467)
parent
dbbf450ef5
commit
ea9b10d112
|
@ -25,7 +25,7 @@ module Localized
|
||||||
end
|
end
|
||||||
|
|
||||||
def available_locale_or_nil(locale_name)
|
def available_locale_or_nil(locale_name)
|
||||||
locale_name.to_sym if locale_name.present? && I18n.available_locales.include?(locale_name.to_sym)
|
locale_name.to_sym if locale_name.respond_to?(:to_sym) && I18n.available_locales.include?(locale_name.to_sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
def content_locale
|
def content_locale
|
||||||
|
|
Loading…
Reference in New Issue