Redmine 4.1.7

This commit is contained in:
Manuel Cillero 2023-07-07 08:08:27 +02:00
parent 55458d3479
commit 3ca3c37487
103 changed files with 2426 additions and 431 deletions

View file

@ -178,6 +178,14 @@ module Redmine
(path[-1,1] == "/") ? path[0..-2] : path
end
def valid_name?(name)
return true if name.nil?
return true if name.is_a?(Integer) && name > 0
return true if name.is_a?(String) && name =~ /\A[0-9]*\z/
false
end
private
def retrieve_root_url

View file

@ -388,6 +388,18 @@ module Redmine
nil
end
def valid_name?(name)
return false unless name.is_a?(String)
return false if name.start_with?('-', '/', 'refs/heads/', 'refs/remotes/')
return false if name == 'HEAD'
git_cmd ['show-ref', '--heads', '--tags', '--quiet', '--', name]
true
rescue ScmCommandAborted
false
end
class Revision < Redmine::Scm::Adapters::Revision
# Returns the readable identifier
def format_identifier

View file

@ -291,6 +291,15 @@ module Redmine
Annotate.new
end
def valid_name?(name)
return false unless name.nil? || name.is_a?(String)
# Mercurials names don't need to be checked further as its CLI
# interface is restrictive enough to reject any invalid names on its
# own.
true
end
class Revision < Redmine::Scm::Adapters::Revision
# Returns the readable identifier
def format_identifier