Commit 44b5c7a0 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mo-fix-warning-csv' into 'master'

Fix warning deprecation

See merge request gitlab-org/gitlab!54370
parents 5ccc418c 3907d85f
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
class CsvBuilder class CsvBuilder
DEFAULT_ORDER_BY = 'id'.freeze DEFAULT_ORDER_BY = 'id'.freeze
DEFAULT_BATCH_SIZE = 1000 DEFAULT_BATCH_SIZE = 1000
PREFIX_REGEX = /^[=\+\-@;]/.freeze
attr_reader :rows_written attr_reader :rows_written
...@@ -114,8 +115,8 @@ class CsvBuilder ...@@ -114,8 +115,8 @@ class CsvBuilder
def excel_sanitize(line) def excel_sanitize(line)
return if line.nil? return if line.nil?
return line unless line.is_a?(String) && line.match?(PREFIX_REGEX)
line = ["'", line].join if line =~ /^[=\+\-@;]/ ["'", line].join
line
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment