1
0
Fork 0
discourse-custom-wizard-unl.../controllers/extra_locales_controller.rb

20 Zeilen
572 B
Ruby

2019-12-05 09:05:21 +01:00
module CustomWizardExtraLocalesController
def show
if request.referer && URI(request.referer).path.include?('/w/')
bundle = params[:bundle]
if params[:v]&.size == 32
hash = ExtraLocalesController.bundle_js_hash(bundle)
immutable_for(1.year) if hash == params[:v]
end
render plain: ExtraLocalesController.bundle_js(bundle), content_type: "application/javascript"
else
super
end
end
end
class ExtraLocalesController
prepend CustomWizardExtraLocalesController if SiteSetting.custom_wizard_enabled
end