X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5f4dcd34ff5943ff4de39bc8322013376a6de8b9..8cf16fe78b85743f284413fd8542f890bd6865fa:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 632974f4f..51db8296d 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -46,7 +46,7 @@ class AmfController < ApplicationController def amf_read self.status = :ok - self.content_type = Mime::AMF + self.content_type = Mime[:amf] self.response_body = Dispatcher.new(request.raw_post) do |message, *args| logger.info("Executing AMF #{message}(#{args.join(',')})") @@ -74,7 +74,7 @@ class AmfController < ApplicationController err = false # Abort batch on error self.status = :ok - self.content_type = Mime::AMF + self.content_type = Mime[:amf] self.response_body = Dispatcher.new(request.raw_post) do |message, *args| logger.info("Executing AMF #{message}") @@ -220,14 +220,14 @@ class AmfController < ApplicationController loaded_lang = "en" # Load English defaults - en = YAML.load(File.open("#{Rails.root}/config/potlatch/locales/en.yml"))["en"] + en = YAML.safe_load(File.open(Rails.root.join("config", "potlatch", "locales", "en.yml")))["en"] if lang == "en" return [loaded_lang, en] else # Use English as a fallback begin - other = YAML.load(File.open("#{Rails.root}/config/potlatch/locales/#{lang}.yml"))[lang] + other = YAML.safe_load(File.open(Rails.root.join("config", "potlatch", "locales", "#{lang}.yml")))[lang] loaded_lang = lang rescue other = en @@ -875,7 +875,7 @@ class AmfController < ApplicationController end def getlocales - @locales ||= Locale.list(Dir.glob("#{Rails.root}/config/potlatch/locales/*").collect { |f| File.basename(f, ".yml") }) + @locales ||= Locale.list(Dir.glob(Rails.root.join("config", "potlatch", "locales", "*")).collect { |f| File.basename(f, ".yml") }) end ##