Project

General

Profile

Actions

Patch #44824

closed

Viewing a Markdown or Textile file larger than file_max_size_displayed in the repository browser raises an error

Patch #44824: Viewing a Markdown or Textile file larger than file_max_size_displayed in the repository browser raises an error

Added by Jens Krämer 3 days ago. Updated 2 days ago.

Status:
Closed
Priority:
Normal
Category:
SCM
Target version:

Description

RepositoriesController#entry leaves @content nil for files larger than "Maximum size of text files displayed inline" (file_max_size_displayed). entry.html.erb still renders Markdown and Textile files as markup and passes nil to the formatter, so viewing such a file fails with a 500:

ActionView::Template::Error: undefined method 'delete' for nil
  lib/redmine/wiki_formatting/common_mark/markdown_filter.rb:36:in 'Redmine::WikiFormatting::CommonMark::MarkdownFilter#initialize'

Other text files fall back to the "No preview available" message.

The attached patch renders markup only if there is content, and adds a test.


Files

Updated by Marius BĂLTEANU 3 days ago Actions #1

  • Category set to SCM
  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Target version set to 6.1.8

Updated by Marius BĂLTEANU 2 days ago Actions #2

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom