]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_preference_controller.rb
Fixed dumb-arse bug with wrong variable name. Added tag cleanup and checking on nodes...
[rails.git] / app / controllers / user_preference_controller.rb
index 68ea88eeac5922def89f7e7e947f73c68332e072..59573047acc3591e22621f1fb041b99abe3f95d9 100644 (file)
@@ -52,7 +52,11 @@ class UserPreferenceController < ApplicationController
 
   # update the entire set of preferences
   def update
-    p = XML::Parser.string(request.raw_post)
+    begin
+      p = XML::Parser.string(request.raw_post)
+    rescue LibXML::XML::Error, ArgumentError => ex
+      raise OSM::APIBadXMLError.new("preferences", xml, ex.message)
+    end
     doc = p.parse
 
     prefs = []