]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Fix title alignment in Outlook/WindowsMail
[rails.git] / app / controllers / amf_controller.rb
index 632974f4fa28042412b832cf2754d9500982f0d9..47a28fd4041fd46a6a0c3eca84be7dff37cfe54d 100644 (file)
@@ -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
 
   ##