Skip to content

Commit

Permalink
Limit size of rights content. #688
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 21, 2020
1 parent 02e7ec3 commit b260177
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ def self.import_one(doi_id: nil, id: nil)
else
doi = Doi.where(id: id).first
end

if doi.blank?
message = "[MySQL] Error importing DOI #{doi_id}: not found"
Rails.logger.error message
Expand Down Expand Up @@ -1859,6 +1859,7 @@ def check_dates
def check_rights_list
Array.wrap(rights_list).each do |r|
errors.add(:rights_list, "Rights '#{r}' should be an object instead of a string.") unless r.is_a?(Hash)
errors.add(:rights_list, "Rights should not have a length of more than 2000 characters.") if r["rights"].length > 2000
end
end

Expand Down
Loading

0 comments on commit b260177

Please sign in to comment.