X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bed9cd00ed166ce346da4b8a9b654ddf86e64e70..a80b42652bfbe6d5362db3f37ad3285d57e4f300:/app/controllers/user_preference_controller.rb?ds=sidebyside diff --git a/app/controllers/user_preference_controller.rb b/app/controllers/user_preference_controller.rb index 68ea88eea..59573047a 100644 --- a/app/controllers/user_preference_controller.rb +++ b/app/controllers/user_preference_controller.rb @@ -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 = []