lib/wordmove/sql_mover.rb in wordmove-1.0.3 vs lib/wordmove/sql_mover.rb in wordmove-1.0.4
- old
+ new
@@ -41,13 +41,13 @@
end
def serialized_replace!(source_field, dest_field)
length_delta = source_field.length - dest_field.length
- sql_content.gsub!(/s:(\d+):"#{Regexp.escape(source_field)}/) do |match|
+ sql_content.gsub!(/s:(\d+):([\\'"]+)#{Regexp.escape(source_field)}/) do |match|
source_length = $1.to_i
dest_length = source_length - length_delta
- "s:#{dest_length}:\"#{dest_field}"
+ "s:#{dest_length}:#{$2}#{dest_field}"
end
end
def simple_replace!(source_field, dest_field)
sql_content.gsub!(source_field, dest_field)