summaryrefslogtreecommitdiff
path: root/spec/models/repository_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-01-15 14:49:27 +0000
committerSean McGivern <sean@gitlab.com>2018-01-16 11:56:07 +0000
commit82f4564fb7dc57a9a7bb6a052926ee219bb29b13 (patch)
tree47ba9aacaa5ca1be77a97800021d2c3821dd0799 /spec/models/repository_spec.rb
parent1df5c74fc94a0fbeb7b89b7e10655626b58a5bc6 (diff)
downloadgitlab-ce-82f4564fb7dc57a9a7bb6a052926ee219bb29b13.tar.gz
Fix project search results for digits surrounded by colons
A file containing /:\d+:/ in its contents would break the search results if those contents were part of the results, because we were splitting on colons, which can't work with untrusted input. Changing to use the null byte as a separator is much safer.
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index f3456e5b354..7e215e37de3 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -657,7 +657,7 @@ describe Repository do
subject { results.first }
it { is_expected.to be_an String }
- it { expect(subject.lines[2]).to eq("master:CHANGELOG:190: - Feature: Replace teams with group membership\n") }
+ it { expect(subject.lines[2]).to eq("master:CHANGELOG\x00190\x00 - Feature: Replace teams with group membership\n") }
end
end