From 5fc22bfabd619115c1df28d30a951084508b28ed Mon Sep 17 00:00:00 2001 From: Stefan Hanreich Date: Thu, 11 May 2017 20:14:15 +0200 Subject: updated regex to use beginning / ending of string metacharacters --- app/models/ci/build.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index f190dcf306c..58bd0586ce8 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -191,7 +191,7 @@ module Ci def ref_slug slugified = ref.to_s.downcase slugified = slugified.gsub(/[^a-z0-9]/, '-')[0..62] - slugified.gsub(/(^\-+|\-+$)/, '') + slugified.gsub(/(\A-+|-+\z)/, '') end # Variables whose value does not depend on other variables -- cgit v1.2.1