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:
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 8431c5f228c..8f64d87d635 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -251,7 +251,8 @@ module Ci
def extract_coverage(text, regex)
return unless regex
- matches = text.scan(Regexp.new(regex)).last
+ regex = Gitlab::UntrustedRegexp.new(regex)
+ matches = regex.scan(text).last
matches = matches.last if matches.is_a?(Array)
coverage = matches.gsub(/\d+(\.\d+)?/).first