diff --git a/app/models/design/theme.rb b/app/models/design/theme.rb index c1c2caf6..612f4fbd 100644 --- a/app/models/design/theme.rb +++ b/app/models/design/theme.rb @@ -6,14 +6,14 @@ class Theme < Stylesheet before_save :set_name def parse_urls - orig_content = content = self.file.read + orig_content = content = self.file.read.force_encoding("UTF-8") self.remove_file! self.remove_file_orig! names = [] images = self.design.images content.scan(/(?<=url\()(.*?)(?=\))/){ css_name = $1 - name = File.basename(css_name).gsub(/[\\\"]/, '') + name = File.basename(css_name).gsub(/[\\\"]/, '').strip file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil names << [css_name, file_name] }