X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c273b4b1faa6dd3d8aba3d5556605f683326948a..b7f306a437f1b0d6960cdafb348a5c15366ec53e:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index 40a024b8b..92d8f735a 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -191,6 +191,11 @@ class Way < ActiveRecord::Base # in the hash to be overwritten. raise OSM::APIDuplicateTagsError.new("way", self.id, k) if @tags.include? k + # check tag size here, as we don't create a WayTag object until + # just before we save... + raise OSM::APIBadUserInput.new("Way #{self.id} has a tag with too long a key, '#{k}'.") if k.length > 255 + raise OSM::APIBadUserInput.new("Way #{self.id} has a tag with too long a value, '#{k}'='#{v}'.") if v.length > 255 + @tags[k] = v end