Add latest changes from gitlab-org/security/gitlab@14-5-stable-ee

This commit is contained in:
GitLab Bot 2021-12-03 10:02:00 +00:00
parent 7418d0b3eb
commit f617de3476
2 changed files with 9 additions and 3 deletions

View File

@ -29,9 +29,7 @@ module Gitlab
# Anything, including `/cmd arg` which are ignored by this filter
# `
`\n*
.+?
\n*`
`.+?`
)
}mix.freeze

View File

@ -352,6 +352,14 @@ RSpec.describe Gitlab::QuickActions::Extractor do
expect(commands).to eq(expected_commands)
expect(msg).to eq expected_msg
end
it 'fails fast for strings with many newlines' do
msg = '`' + "\n" * 100_000
expect do
Timeout.timeout(3.seconds) { extractor.extract_commands(msg) }
end.not_to raise_error
end
end
describe '#redact_commands' do