X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c76e60f052051a35fe7e9044969337cd88e5b1fd..6e64d5474ffe6fde6a31f642c008c152a99c60a2:/app/controllers/user_preference_controller.rb diff --git a/app/controllers/user_preference_controller.rb b/app/controllers/user_preference_controller.rb index 3b56c257b..59573047a 100644 --- a/app/controllers/user_preference_controller.rb +++ b/app/controllers/user_preference_controller.rb @@ -52,8 +52,11 @@ class UserPreferenceController < ApplicationController # update the entire set of preferences def update - p = XML::Parser.new - p.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 = []