mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 11:25:55 +01:00
Ruby 3.2: Changeset.normalize_comments raises Encoding::CompatibilityError if the string contains an invalid UTF-8 byte sequence (#38099, #38100).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22000 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -296,7 +296,7 @@ class Changeset < ActiveRecord::Base
|
|||||||
class << self
|
class << self
|
||||||
# Strips and reencodes a commit log before insertion into the database
|
# Strips and reencodes a commit log before insertion into the database
|
||||||
def normalize_comments(str, encoding)
|
def normalize_comments(str, encoding)
|
||||||
Changeset.to_utf8(str.to_s.strip, encoding)
|
Changeset.to_utf8(str.to_s, encoding).strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_utf8(str, encoding)
|
def to_utf8(str, encoding)
|
||||||
|
|||||||
Reference in New Issue
Block a user