summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/change.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/change.rb b/app/models/change.rb
index a5cfccf22..f509f5806 100644
--- a/app/models/change.rb
+++ b/app/models/change.rb
@@ -20,12 +20,13 @@ class Change < ActiveRecord::Base
validates_presence_of :changeset_id, :action, :path
before_save :init_path
+ before_validation :replace_invalid_utf8_of_path
def relative_path
changeset.repository.relative_path(path)
end
- def before_validation
+ def replace_invalid_utf8_of_path
self.path = Redmine::CodesetUtil.replace_invalid_utf8(self.path)
self.from_path = Redmine::CodesetUtil.replace_invalid_utf8(self.from_path)
end