From 2666ef9f04b6a130f342a23124cad927ac1c6068 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 7 Feb 2017 14:26:00 -0600 Subject: Use stricter regex anchors --- lib/gitlab/route_map.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/route_map.rb b/lib/gitlab/route_map.rb index f96c30b3e33..72d00abfcc2 100644 --- a/lib/gitlab/route_map.rb +++ b/lib/gitlab/route_map.rb @@ -35,7 +35,7 @@ module Gitlab source_pattern = source_pattern[1...-1].gsub('\/', '/') begin - source_pattern = Regexp.new("^#{source_pattern}$") + source_pattern = /\A#{source_pattern}\z/ rescue RegexpError => e raise FormatError, "Route map entry source is not a valid regular expression: #{e}" end -- cgit v1.2.1