Project

General

Profile

Patch #37591 ยป use_start_with.patch

Go MAEDA, 2022-08-22 11:19

View differences:

lib/redmine/diff_table.rb
end
def parse_line(line, type="inline")
if line[0, 1] == "+"
if line.start_with?('+')
diff = diff_for_added_line
diff.line_right = line[1..-1]
diff.nb_line_right = @line_num_r
......
@line_num_r += 1
@added += 1
true
elsif line[0, 1] == "-"
elsif line.start_with?('-')
diff = Diff.new
diff.line_left = line[1..-1]
diff.nb_line_left = @line_num_l
......
true
else
write_offsets
if /\s/.match?(line[0, 1])
if line.start_with?(/\s/)
diff = Diff.new
diff.line_right = line[1..-1]
diff.nb_line_right = @line_num_r
......
end
end
end
end
end
lib/redmine/export/pdf.rb
end
def get_sever_url(url)
if !empty_string(url) and (url[0, 1] == '/')
if !empty_string(url) and url.start_with?('/')
Setting.host_name.split('/')[0] + url
else
url
lib/redmine/scm/adapters/abstract_adapter.rb
def with_leading_slash(path)
path ||= ''
(path[0, 1]!="/") ? "/#{path}" : path
path.start_with?('/') ? path : "/#{path}"
end
def with_trailling_slash(path)
path ||= ''
(path[-1, 1] == "/") ? path : "#{path}/"
path.end_with?('/') ? path : "#{path}/"
end
def without_leading_slash(path)
......
def without_trailling_slash(path)
path ||= ''
(path[-1, 1] == "/") ? path[0..-2] : path
path.end_with?('/') ? path[0..-2] : path
end
def valid_name?(name)
    (1-1/1)