[FIX] invalid byte sequence in UTF-8 (#5003)

Invalid encoding fixed prior to empty check
This commit is contained in:
Mohammad AlTawil 2017-07-31 22:34:11 +03:00 committed by Sam
parent f1eccd113c
commit 7836b064f4

View File

@ -521,8 +521,8 @@ class BulkImport::Base
end
def fix_name(name)
name.scrub! if name.valid_encoding? == false
return if name.blank?
name.scrub!
name = ActiveSupport::Inflector.transliterate(name)
name.gsub!(/[^\w.-]+/, "_")
name.gsub!(/^\W+/, "")