scm: prevent PostgreSQL or Ruby 1.9 errors if paths is invalid UTF-8.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5475 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a78b12706a
commit
5512e397ee
@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -25,6 +25,11 @@ class Change < ActiveRecord::Base
|
||||
changeset.repository.relative_path(path)
|
||||
end
|
||||
|
||||
def before_validation
|
||||
self.path = Redmine::CodesetUtil.replace_invalid_utf8(self.path)
|
||||
self.from_path = Redmine::CodesetUtil.replace_invalid_utf8(self.from_path)
|
||||
end
|
||||
|
||||
def init_path
|
||||
self.path ||= ""
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user