From da5c28a422e3966f6f6780d5e23f13eda4881108 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 14 May 2018 10:43:45 +0200 Subject: Backport EE-specific untrusted regexp implementation --- spec/lib/gitlab/untrusted_regexp_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') diff --git a/spec/lib/gitlab/untrusted_regexp_spec.rb b/spec/lib/gitlab/untrusted_regexp_spec.rb index bed58d407ef..0ee7fa1e570 100644 --- a/spec/lib/gitlab/untrusted_regexp_spec.rb +++ b/spec/lib/gitlab/untrusted_regexp_spec.rb @@ -39,6 +39,14 @@ describe Gitlab::UntrustedRegexp do expect(result).to be_falsy end + + it 'can handle regular expressions in multiline mode' do + regexp = described_class.new('^\d', multiline: true) + + result = regexp === "Header\n\n1. Content" + + expect(result).to be_truthy + end end describe '#scan' do -- cgit v1.2.1