Welcome to mirror list, hosted at ThFree Co, Russian Federation.

protected_ref_name_sanitizer.rb « concerns « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3966c410fecf3c62028052000f3966b6b643c234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

module ProtectedRefNameSanitizer
  def sanitize_name(name)
    name = CGI.unescapeHTML(name)
    name = Sanitize.fragment(name)

    # Sanitize.fragment escapes HTML chars, so unescape again to allow names
    # like `feature->master`
    CGI.unescapeHTML(name)
  end
end