Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 19:26:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 19:26:10 +0300
commit6653ccc011dec86e5140a5d09ea3b2357eab6714 (patch)
tree897193f37bcd98152a0ac214f80a3c4cfe1047c5 /lib/csv_builder.rb
parentbff35a05aed6a31380a73c39113808fd262c2c37 (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc41
Diffstat (limited to 'lib/csv_builder.rb')
-rw-r--r--lib/csv_builder.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/csv_builder.rb b/lib/csv_builder.rb
index a9ef5a83ae8..6116009f171 100644
--- a/lib/csv_builder.rb
+++ b/lib/csv_builder.rb
@@ -16,6 +16,7 @@
class CsvBuilder
DEFAULT_ORDER_BY = 'id'.freeze
DEFAULT_BATCH_SIZE = 1000
+ PREFIX_REGEX = /^[=\+\-@;]/.freeze
attr_reader :rows_written
@@ -114,8 +115,8 @@ class CsvBuilder
def excel_sanitize(line)
return if line.nil?
+ return line unless line.is_a?(String) && line.match?(PREFIX_REGEX)
- line = ["'", line].join if line =~ /^[=\+\-@;]/
- line
+ ["'", line].join
end
end