Skip to content

Commit

Permalink
Ruby 3.x: use URI::DEFAULT_PARSER.unescape instead of URI.unescape (f…
Browse files Browse the repository at this point in the history
…ixes #351)
  • Loading branch information
ryanfb committed Dec 2, 2024
1 parent c7b3e1f commit 58ff0f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def self.stats(user_id)
stats = ActiveRecord::Base.connection.execute("select p.id AS pub_id, p.title AS pub_title, p.status AS pub_status, i.title AS id_title, c.comment AS comment, c.reason AS reason, c.created_at AS created_at from comments c LEFT OUTER JOIN publications p ON c.publication_id=p.id LEFT OUTER JOIN identifiers i ON c.identifier_id=i.id where c.user_id=#{user_id} ORDER BY c.created_at;")
stats.each do |row|
row['created_at'] = DateTime.parse(row['created_at'].to_s)
row['comment'] = URI.unescape(row['comment']).tr('+', ' ') unless row['comment'].nil?
row['comment'] = URI::DEFAULT_PARSER.unescape(row['comment']).tr('+', ' ') unless row['comment'].nil?
end
end
end
Expand Down

0 comments on commit 58ff0f0

Please sign in to comment.