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-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /lib/csv_builder.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
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