Commit 19d5b10e authored by jplang's avatar jplang

Fixed that empty Markdown image tag raises en error (#23246).

git-svn-id: https://svn.redmine.org/redmine/trunk@15607 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 4388e732
......@@ -23,7 +23,7 @@ module Redmine
def uri_with_safe_scheme?(uri, schemes = ['http', 'https', 'ftp', 'mailto', nil])
# URLs relative to the current document or document root (without a protocol
# separator, should be harmless
return true unless uri.include? ":"
return true unless uri.to_s.include? ":"
# Other URLs need to be parsed
schemes.include? URI.parse(uri).scheme
......
......@@ -28,6 +28,10 @@ class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase
assert @formatter.new("!>[](foo.png)").to_html
end
def test_empty_image_should_not_raise_exception
assert @formatter.new("![]()").to_html
end
# re-using the formatter after getting above error crashes the
# ruby interpreter. This seems to be related to
# https://github.com/vmg/redcarpet/issues/318
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment