Project

General

Profile

Patch #44824 » 0001-Do-not-render-markup-of-repository-files-too-large-t.patch

Jens Krämer, 2026-12-03 05:16

View differences:

app/views/repositories/entry.html.erb
<%= render :partial => 'common/image', :locals => {:path => @raw_url, :alt => @path} %>
<% elsif Redmine::MimeType.of(@path) == 'application/pdf' %>
<%= render :partial => 'common/pdf', :locals => {:path => @raw_url} %>
<% elsif Redmine::MimeType.of(@path) == 'text/x-textile' %>
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'textile', :markup_text => @content} %>
<% elsif Redmine::MimeType.of(@path) == 'text/markdown' %>
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'common_mark', :markup_text => @content} %>
<% elsif @content %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% if Redmine::MimeType.of(@path) == 'text/x-textile' %>
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'textile', :markup_text => @content} %>
<% elsif Redmine::MimeType.of(@path) == 'text/markdown' %>
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'common_mark', :markup_text => @content} %>
<% else %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% end %>
<% else %>
<% kind = if Redmine::MimeType.is_type?('video', @path)
'video'
test/functional/repositories_subversion_controller_test.rb
end
end
def test_entry_should_show_other_for_markup_if_too_big
with_settings :file_max_size_displayed => 0 do
get(
:entry,
:params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'testfile.md'])[:param]
}
)
assert_response :success
assert_select 'div.wiki', 0
assert_select 'p.nodata'
end
end
def test_entry_should_display_images
get(
:entry,
    (1-1/1)