]> source.dussan.org Git - redmine.git/commitdiff
Fix rendering invalid URI fails with exception in CommonMark Markdown (#36958).
authorMarius Balteanu <marius.balteanu@zitec.com>
Tue, 3 May 2022 16:50:20 +0000 (16:50 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Tue, 3 May 2022 16:50:20 +0000 (16:50 +0000)
Patch by Holger Just.

git-svn-id: https://svn.redmine.org/redmine/trunk@21558 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/common_mark/external_links_filter.rb

index d2ea3fafacdef3a0e608c21e77c64ad88af30e4f..4c25a7b133981679fb096a4b58712dcbaaeb0ace 100644 (file)
@@ -31,7 +31,7 @@ module Redmine
             next unless url
             next if url.starts_with?("/") || url.starts_with?("#") || !url.include?(':')
 
-            scheme = URI.parse(url).scheme
+            scheme = URI.parse(url).scheme rescue nil
             next if scheme.blank?
 
             klass = node["class"].presence