diff options
author | Go MAEDA <maeda@farend.jp> | 2022-12-26 01:36:44 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-12-26 01:36:44 +0000 |
commit | f186e614eefbcdb56c79c2dbb37b426799e9efe9 (patch) | |
tree | f3a95533ca839d7e65dfcdd6dad4029d643418ae | |
parent | cec30f9a05e2b5def4db6660043e34641a77dff7 (diff) | |
download | redmine-f186e614eefbcdb56c79c2dbb37b426799e9efe9.tar.gz redmine-f186e614eefbcdb56c79c2dbb37b426799e9efe9.zip |
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
-rw-r--r-- | app/models/changeset.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb index b4501b19e..db55c3e3b 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -296,7 +296,7 @@ class Changeset < ActiveRecord::Base class << self # Strips and reencodes a commit log before insertion into the database def normalize_comments(str, encoding) - Changeset.to_utf8(str.to_s.strip, encoding) + Changeset.to_utf8(str.to_s, encoding).strip end def to_utf8(str, encoding) |